Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11315 for trunk/sources


Ignore:
Timestamp:
08/27/14 14:02:05 (10 years ago)
Author:
bburlacu
Message:

#2237: Added RandomForestUtil class implementing fold generation, cross-validation and grid search. Overloaded CreateRegressionModel method to accept a user-specified data partition.

Location:
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest
Files:
1 added
1 edited

Legend:

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

    r11171 r11315  
    7676      // we assume that the trees array (double[]) is immutable in alglib
    7777      randomForest.innerobj.trees = original.randomForest.innerobj.trees;
    78      
     78
    7979      // allowedInputVariables is immutable so we don't need to clone
    8080      allowedInputVariables = original.allowedInputVariables;
     
    189189    public static RandomForestModel CreateRegressionModel(IRegressionProblemData problemData, int nTrees, double r, double m, int seed,
    190190      out double rmsError, out double avgRelError, out double outOfBagAvgRelError, out double outOfBagRmsError) {
    191 
     191      return CreateRegressionModel(problemData, nTrees, r, m, seed, out rmsError, out avgRelError, out outOfBagAvgRelError, out outOfBagRmsError, problemData.TrainingIndices);
     192    }
     193
     194    public static RandomForestModel CreateRegressionModel(IRegressionProblemData problemData, int nTrees, double r, double m, int seed,
     195      out double rmsError, out double avgRelError, out double outOfBagAvgRelError, out double outOfBagRmsError, IEnumerable<int> trainingIndices) {
    192196      var variables = problemData.AllowedInputVariables.Concat(new string[] { problemData.TargetVariable });
    193197      double[,] inputMatrix = AlglibUtil.PrepareInputMatrix(problemData.Dataset, variables, problemData.TrainingIndices);
Note: See TracChangeset for help on using the changeset viewer.