Changeset 16538 for branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest
- Timestamp:
- 01/18/19 14:39:01 (6 years ago)
- Location:
- branches/2847_M5Regression
- Files:
-
- 8 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
-
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:mergeinfo changed
-
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassification.cs
r15614 r16538 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 135 135 protected override void Run(CancellationToken cancellationToken) { 136 136 double rmsError, relClassificationError, outOfBagRmsError, outOfBagRelClassificationError; 137 if (SetSeedRandomly) Seed = new System.Random().Next();137 if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed(); 138 138 139 139 var model = CreateRandomForestClassificationModel(Problem.ProblemData, NumberOfTrees, R, M, Seed, out rmsError, out relClassificationError, out outOfBagRmsError, out outOfBagRelClassificationError); -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassificationSolution.cs
r14345 r16538 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs
r15614 r16538 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 286 286 } 287 287 288 public bool IsProblemDataCompatible(IRegressionProblemData problemData, out string errorMessage) { 289 return RegressionModel.IsProblemDataCompatible(this, problemData, out errorMessage); 290 } 291 292 public override bool IsProblemDataCompatible(IDataAnalysisProblemData problemData, out string errorMessage) { 293 if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null."); 294 295 var regressionProblemData = problemData as IRegressionProblemData; 296 if (regressionProblemData != null) 297 return IsProblemDataCompatible(regressionProblemData, out errorMessage); 298 299 var classificationProblemData = problemData as IClassificationProblemData; 300 if (classificationProblemData != null) 301 return IsProblemDataCompatible(classificationProblemData, out errorMessage); 302 303 throw new ArgumentException("The problem data is not a regression nor a classification problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData"); 304 } 305 288 306 public static RandomForestModel CreateRegressionModel(IRegressionProblemData problemData, int nTrees, double r, double m, int seed, 289 307 out double rmsError, out double outOfBagRmsError, out double avgRelError, out double outOfBagAvgRelError) { … … 310 328 public static RandomForestModel CreateClassificationModel(IClassificationProblemData problemData, int nTrees, double r, double m, int seed, 311 329 out double rmsError, out double outOfBagRmsError, out double relClassificationError, out double outOfBagRelClassificationError) { 312 return CreateClassificationModel(problemData, problemData.TrainingIndices, nTrees, r, m, seed, 330 return CreateClassificationModel(problemData, problemData.TrainingIndices, nTrees, r, m, seed, 313 331 out rmsError, out outOfBagRmsError, out relClassificationError, out outOfBagRelClassificationError); 314 332 } … … 370 388 371 389 private static void AssertInputMatrix(double[,] inputMatrix) { 372 if (inputMatrix.C ast<double>().Any(x => Double.IsNaN(x) || Double.IsInfinity(x)))390 if (inputMatrix.ContainsNanOrInfinity()) 373 391 throw new NotSupportedException("Random forest modeling does not support NaN or infinity values in the input dataset."); 374 392 } -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegression.cs
r15614 r16538 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 134 134 protected override void Run(CancellationToken cancellationToken) { 135 135 double rmsError, avgRelError, outOfBagRmsError, outOfBagAvgRelError; 136 if (SetSeedRandomly) Seed = new System.Random().Next();136 if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed(); 137 137 var model = CreateRandomForestRegressionModel(Problem.ProblemData, NumberOfTrees, R, M, Seed, 138 138 out rmsError, out avgRelError, out outOfBagRmsError, out outOfBagAvgRelError); -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegressionSolution.cs
r15430 r16538 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestUtil.cs
r14185 r16538 2 2 3 3 /* HeuristicLab 4 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)4 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 5 5 * 6 6 * This file is part of HeuristicLab.
Note: See TracChangeset
for help on using the changeset viewer.