Changeset 18027 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs
- Timestamp:
- 07/20/21 18:13:55 (3 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Algorithms.DataAnalysis merged: 17931,17934,17942,17979
- Property svn:mergeinfo changed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Algorithms.DataAnalysis/3.4 merged: 17931,17934,17942,17979
- Property svn:mergeinfo changed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs
r17180 r18027 20 20 #endregion 21 21 22 extern alias alglib_3_7; 23 22 24 using System; 23 25 using System.Collections.Generic; … … 39 41 public sealed class RandomForestModel : ClassificationModel, IRandomForestModel { 40 42 // 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 { 43 45 get { 44 46 // recalculate lazily … … 74 76 private RandomForestModel(StorableConstructorFlag _) : base(_) { 75 77 // for backwards compatibility (loading old solutions) 76 randomForest = new alglib .decisionforest();78 randomForest = new alglib_3_7.alglib.decisionforest(); 77 79 } 78 80 private RandomForestModel(RandomForestModel original, Cloner cloner) 79 81 : base(original, cloner) { 80 randomForest = new alglib .decisionforest();82 randomForest = new alglib_3_7.alglib.decisionforest(); 81 83 randomForest.innerobj.bufsize = original.randomForest.innerobj.bufsize; 82 84 randomForest.innerobj.nclasses = original.randomForest.innerobj.nclasses; … … 100 102 101 103 // 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, 103 105 int seed, IDataAnalysisProblemData originalTrainingData, 104 106 int nTrees, double r, double m, double[] classValues = null) … … 151 153 x[column] = inputData[row, column]; 152 154 } 153 alglib .dfprocess(RandomForest, x, ref y);155 alglib_3_7.alglib.dfprocess(RandomForest, x, ref y); 154 156 yield return y[0]; 155 157 } … … 169 171 x[column] = inputData[row, column]; 170 172 } 171 alglib .dforest.dfprocessraw(RandomForest.innerobj, x, ref ys);173 alglib_3_7.alglib.dforest.dfprocessraw(RandomForest.innerobj, x, ref ys); 172 174 yield return ys.VariancePop(); 173 175 } … … 187 189 x[column] = inputData[row, column]; 188 190 } 189 alglib .dfprocess(randomForest, x, ref y);191 alglib_3_7.alglib.dfprocess(randomForest, x, ref y); 190 192 // find class for with the largest probability value 191 193 int maxProbClassIndex = 0; … … 315 317 double[,] inputMatrix = problemData.Dataset.ToArray(variables, trainingIndices); 316 318 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); 319 320 320 321 rmsError = rep.rmserror; … … 353 354 } 354 355 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); 357 357 358 358 rmsError = rep.rmserror;
Note: See TracChangeset
for help on using the changeset viewer.