Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17943


Ignore:
Timestamp:
04/15/21 08:42:25 (4 years ago)
Author:
gkronber
Message:

#3117: fix script sources for RF regression / classification

Location:
trunk/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchRFClassificationScriptSource.cs

    r12292 r17943  
    3838    double rmsError, outOfBagRmsError, relClassificationError, outOfBagRelClassificationError;
    3939    bestParameters = RandomForestUtil.GridSearch(problemData, numberOfFolds, shuffleFolds, randomForestParameterRanges, seed, maximumDegreeOfParallelism);
    40     var model = RandomForestModel.CreateClassificationModel(problemData, problemData.TrainingIndices, bestParameters.N, bestParameters.R, bestParameters.M, seed,
    41                                                             out rmsError, out outOfBagRmsError, out relClassificationError, out outOfBagRelClassificationError);
     40    var model = RandomForestClassification.CreateRandomForestClassificationModel(problemData, problemData.TrainingIndices, bestParameters.N, bestParameters.R, bestParameters.M, seed,
     41                                                                                 out rmsError, out relClassificationError, out outOfBagRmsError, out outOfBagRelClassificationError);
    4242    return (RandomForestClassificationSolution)model.CreateClassificationSolution(problemData);
    4343  }
     
    4646    double rmsError, outOfBagRmsError, relClassificationError, outOfBagRelClassificationError;
    4747    bestParameters = RandomForestUtil.GridSearch(problemData, randomForestParameterRanges, seed, maximumDegreeOfParallelism);
    48     var model = RandomForestModel.CreateClassificationModel(problemData, problemData.TrainingIndices, bestParameters.N, bestParameters.R, bestParameters.M, seed,
    49                                                             out rmsError, out outOfBagRmsError, out relClassificationError, out outOfBagRelClassificationError);
     48    var model = RandomForestClassification.CreateRandomForestClassificationModel(problemData, problemData.TrainingIndices, bestParameters.N, bestParameters.R, bestParameters.M, seed,
     49                                                                                 out rmsError, out relClassificationError, out outOfBagRmsError, out outOfBagRelClassificationError);
    5050    return (RandomForestClassificationSolution)model.CreateClassificationSolution(problemData);
    5151  }
  • trunk/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchRFRegressionScriptSource.cs

    r12292 r17943  
    1414  /* Number of crossvalidation folds: */
    1515  const int numberOfFolds = 3;
    16   /* Specify whether the crossvalidation folds should be shuffled */
    17   const bool shuffleFolds = true;
    1816
    1917  /* The tunable Random Forest parameters:
     
    3735  private static RandomForestRegressionSolution GridSearchWithCrossvalidation(IRegressionProblemData problemData, out RFParameter bestParameters, int seed = 3141519) {
    3836    double rmsError, outOfBagRmsError, avgRelError, outOfBagAvgRelError;
    39     bestParameters = RandomForestUtil.GridSearch(problemData, numberOfFolds, shuffleFolds, randomForestParameterRanges, seed, maximumDegreeOfParallelism);
    40     var model = RandomForestModel.CreateRegressionModel(problemData, problemData.TrainingIndices, bestParameters.N, bestParameters.R, bestParameters.M, seed, out rmsError, out outOfBagRmsError, out avgRelError, out outOfBagAvgRelError);
     37    bestParameters = RandomForestUtil.GridSearch(problemData, numberOfFolds, randomForestParameterRanges, seed, maximumDegreeOfParallelism);
     38    var model = RandomForestRegression.CreateRandomForestRegressionModel(problemData, problemData.TrainingIndices, bestParameters.N, bestParameters.R, bestParameters.M, seed,
     39                                                                         out rmsError, out avgRelError, out outOfBagRmsError, out outOfBagAvgRelError);
    4140    return (RandomForestRegressionSolution)model.CreateRegressionSolution(problemData);
    4241  }
     
    4645    var random = new MersenneTwister();
    4746    bestParameters = RandomForestUtil.GridSearch(problemData, randomForestParameterRanges, seed, maximumDegreeOfParallelism);
    48     var model = RandomForestModel.CreateRegressionModel(problemData, problemData.TrainingIndices, bestParameters.N, bestParameters.R, bestParameters.M, seed,
    49                                                         out rmsError, out outOfBagRmsError, out avgRelError, out outOfBagAvgRelError);
     47    var model = RandomForestRegression.CreateRandomForestRegressionModel(problemData, problemData.TrainingIndices, bestParameters.N, bestParameters.R, bestParameters.M, seed,
     48                                                                         out rmsError, out avgRelError, out outOfBagRmsError, out outOfBagAvgRelError);
    5049    return (RandomForestRegressionSolution)model.CreateRegressionSolution(problemData);
    5150  }
Note: See TracChangeset for help on using the changeset viewer.