Changeset 13653
- Timestamp:
- 03/05/16 19:42:40 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GBM/GradientBoostingRegressionAlgorithm.cs
r13646 r13653 26 26 using System.Threading; 27 27 using HeuristicLab.Analysis; 28 using HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm; 28 29 using HeuristicLab.Common; 29 30 using HeuristicLab.Core; … … 37 38 using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression; 38 39 using HeuristicLab.Random; 40 using HeuristicLab.Selection; 39 41 40 42 namespace HeuristicLab.Algorithms.DataAnalysis.MctsSymbolicRegression { … … 172 174 Problem = new RegressionProblem(); // default problem 173 175 var mctsSymbReg = new MctsSymbolicRegressionAlgorithm(); 174 // var sgp = CreateSGP(); 176 mctsSymbReg.Iterations = 10000; 177 mctsSymbReg.StoreAlgorithmInEachRun = false; 178 var sgp = CreateOSGP(); 175 179 var regressionAlgs = new ItemSet<IAlgorithm>(new IAlgorithm[] { 176 new LinearRegression(), new RandomForestRegression(), new NearestNeighbourRegression(),177 //sgp,180 new RandomForestRegression(), 181 sgp, 178 182 mctsSymbReg 179 183 }); … … 320 324 } 321 325 322 // this is probably slow as hell 326 327 private IAlgorithm CreateOSGP() { 328 // configure strict osgp 329 var alg = new OffspringSelectionGeneticAlgorithm.OffspringSelectionGeneticAlgorithm(); 330 var prob = new SymbolicRegressionSingleObjectiveProblem(); 331 prob.MaximumSymbolicExpressionTreeDepth.Value = 7; 332 prob.MaximumSymbolicExpressionTreeLength.Value = 15; 333 alg.Problem = prob; 334 alg.SuccessRatio.Value = 1.0; 335 alg.ComparisonFactorLowerBound.Value = 1.0; 336 alg.ComparisonFactorUpperBound.Value = 1.0; 337 alg.MutationProbability.Value = 0.15; 338 alg.PopulationSize.Value = 200; 339 alg.MaximumSelectionPressure.Value = 100; 340 alg.MaximumEvaluatedSolutions.Value = 20000; 341 alg.SelectorParameter.Value = alg.SelectorParameter.ValidValues.OfType<GenderSpecificSelector>().First(); 342 alg.MutatorParameter.Value = alg.MutatorParameter.ValidValues.OfType<MultiSymbolicExpressionTreeManipulator>().First(); 343 alg.StoreAlgorithmInEachRun = false; 344 return alg; 345 } 346 323 347 private void SampleTrainingData(MersenneTwister rand, ModifiableDataset ds, int rRows, 324 348 IDataset sourceDs, double[] curTarget, string targetVarName, IEnumerable<int> trainingIndices) { … … 374 398 prob.ProblemDataParameter.Value = problemData; 375 399 return true; 376 } else if (alg.Problem != null) { 377 // a problem is set and it is not compatible 378 return false; 379 } else { 380 try { 381 // we try to use a symbolic regression problem (works for simple regression algs and GP) 382 alg.Problem = new SymbolicRegressionSingleObjectiveProblem(); 383 } catch (Exception) { 384 return false; 385 } 386 return true; 387 } 400 } else return false; 388 401 } 389 402 -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r13646 r13653 322 322 <Private>False</Private> 323 323 </ProjectReference> 324 <ProjectReference Include="..\..\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm\3.3\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.csproj"> 325 <Project>{F409DD9E-1E9C-4EB1-AA3A-9F6E987C6E58}</Project> 326 <Name>HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3</Name> 327 </ProjectReference> 324 328 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 325 329 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> … … 420 424 <Name>HeuristicLab.Random-3.3</Name> 421 425 <Private>False</Private> 426 </ProjectReference> 427 <ProjectReference Include="..\..\HeuristicLab.Selection\3.3\HeuristicLab.Selection-3.3.csproj"> 428 <Project>{2C36CD4F-E5F5-43A4-801A-201EA895FE17}</Project> 429 <Name>HeuristicLab.Selection-3.3</Name> 422 430 </ProjectReference> 423 431 </ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.