Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/09/21 19:41:33 (3 years ago)
Author:
gkronber
Message:

#3117: update alglib to version 3.17

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs

    r17180 r17931  
    2020#endregion
    2121
     22extern alias alglib_3_7;
     23
    2224using System;
    2325using System.Collections.Generic;
     
    3941  public sealed class RandomForestModel : ClassificationModel, IRandomForestModel {
    4042    // not persisted
    41     private alglib.decisionforest randomForest;
    42     private alglib.decisionforest RandomForest {
     43    private alglib_3_7.alglib.decisionforest randomForest;
     44    private alglib_3_7.alglib.decisionforest RandomForest {
    4345      get {
    4446        // recalculate lazily
     
    7476    private RandomForestModel(StorableConstructorFlag _) : base(_) {
    7577      // for backwards compatibility (loading old solutions)
    76       randomForest = new alglib.decisionforest();
     78      randomForest = new alglib_3_7.alglib.decisionforest();
    7779    }
    7880    private RandomForestModel(RandomForestModel original, Cloner cloner)
    7981      : base(original, cloner) {
    80       randomForest = new alglib.decisionforest();
     82      randomForest = new alglib_3_7.alglib.decisionforest();
    8183      randomForest.innerobj.bufsize = original.randomForest.innerobj.bufsize;
    8284      randomForest.innerobj.nclasses = original.randomForest.innerobj.nclasses;
     
    100102
    101103    // random forest models can only be created through the static factory methods CreateRegressionModel and CreateClassificationModel
    102     private RandomForestModel(string targetVariable, alglib.decisionforest randomForest,
     104    private RandomForestModel(string targetVariable, alglib_3_7.alglib.decisionforest randomForest,
    103105      int seed, IDataAnalysisProblemData originalTrainingData,
    104106      int nTrees, double r, double m, double[] classValues = null)
     
    151153          x[column] = inputData[row, column];
    152154        }
    153         alglib.dfprocess(RandomForest, x, ref y);
     155        alglib_3_7.alglib.dfprocess(RandomForest, x, ref y);
    154156        yield return y[0];
    155157      }
     
    169171          x[column] = inputData[row, column];
    170172        }
    171         alglib.dforest.dfprocessraw(RandomForest.innerobj, x, ref ys);
     173        alglib_3_7.alglib.dforest.dfprocessraw(RandomForest.innerobj, x, ref ys);
    172174        yield return ys.VariancePop();
    173175      }
     
    187189          x[column] = inputData[row, column];
    188190        }
    189         alglib.dfprocess(randomForest, x, ref y);
     191        alglib_3_7.alglib.dfprocess(randomForest, x, ref y);
    190192        // find class for with the largest probability value
    191193        int maxProbClassIndex = 0;
     
    315317      double[,] inputMatrix = problemData.Dataset.ToArray(variables, trainingIndices);
    316318
    317       alglib.dfreport rep;
    318       var dForest = RandomForestUtil.CreateRandomForestModel(seed, inputMatrix, nTrees, r, m, 1, out rep);
     319      var dForest = RandomForestUtil.CreateRandomForestModelAlglib_3_7(seed, inputMatrix, nTrees, r, m, 1, out var rep);
    319320
    320321      rmsError = rep.rmserror;
     
    353354      }
    354355
    355       alglib.dfreport rep;
    356       var dForest = RandomForestUtil.CreateRandomForestModel(seed, inputMatrix, nTrees, r, m, nClasses, out rep);
     356      var dForest = RandomForestUtil.CreateRandomForestModelAlglib_3_7(seed, inputMatrix, nTrees, r, m, nClasses, out var rep);
    357357
    358358      rmsError = rep.rmserror;
Note: See TracChangeset for help on using the changeset viewer.