- Timestamp:
- 04/15/21 08:42:25 (4 years ago)
- 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 38 38 double rmsError, outOfBagRmsError, relClassificationError, outOfBagRelClassificationError; 39 39 bestParameters = RandomForestUtil.GridSearch(problemData, numberOfFolds, shuffleFolds, randomForestParameterRanges, seed, maximumDegreeOfParallelism); 40 var model = RandomForest Model.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); 42 42 return (RandomForestClassificationSolution)model.CreateClassificationSolution(problemData); 43 43 } … … 46 46 double rmsError, outOfBagRmsError, relClassificationError, outOfBagRelClassificationError; 47 47 bestParameters = RandomForestUtil.GridSearch(problemData, randomForestParameterRanges, seed, maximumDegreeOfParallelism); 48 var model = RandomForest Model.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); 50 50 return (RandomForestClassificationSolution)model.CreateClassificationSolution(problemData); 51 51 } -
trunk/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchRFRegressionScriptSource.cs
r12292 r17943 14 14 /* Number of crossvalidation folds: */ 15 15 const int numberOfFolds = 3; 16 /* Specify whether the crossvalidation folds should be shuffled */17 const bool shuffleFolds = true;18 16 19 17 /* The tunable Random Forest parameters: … … 37 35 private static RandomForestRegressionSolution GridSearchWithCrossvalidation(IRegressionProblemData problemData, out RFParameter bestParameters, int seed = 3141519) { 38 36 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); 41 40 return (RandomForestRegressionSolution)model.CreateRegressionSolution(problemData); 42 41 } … … 46 45 var random = new MersenneTwister(); 47 46 bestParameters = RandomForestUtil.GridSearch(problemData, randomForestParameterRanges, seed, maximumDegreeOfParallelism); 48 var model = RandomForest Model.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); 50 49 return (RandomForestRegressionSolution)model.CreateRegressionSolution(problemData); 51 50 }
Note: See TracChangeset
for help on using the changeset viewer.