Changeset 13653


Ignore:
Timestamp:
03/05/16 19:42:40 (5 years ago)
Author:
gkronber
Message:

#1795: added OSGP for gradient boosting meta-learner

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  
    2626using System.Threading;
    2727using HeuristicLab.Analysis;
     28using HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm;
    2829using HeuristicLab.Common;
    2930using HeuristicLab.Core;
     
    3738using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
    3839using HeuristicLab.Random;
     40using HeuristicLab.Selection;
    3941
    4042namespace HeuristicLab.Algorithms.DataAnalysis.MctsSymbolicRegression {
     
    172174      Problem = new RegressionProblem(); // default problem
    173175      var mctsSymbReg = new MctsSymbolicRegressionAlgorithm();
    174       // var sgp = CreateSGP();
     176      mctsSymbReg.Iterations = 10000;
     177      mctsSymbReg.StoreAlgorithmInEachRun = false;
     178      var sgp = CreateOSGP();
    175179      var regressionAlgs = new ItemSet<IAlgorithm>(new IAlgorithm[] {
    176         new LinearRegression(), new RandomForestRegression(), new NearestNeighbourRegression(),
    177         // sgp,
     180        new RandomForestRegression(),
     181        sgp,
    178182        mctsSymbReg
    179183      });
     
    320324    }
    321325
    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
    323347    private void SampleTrainingData(MersenneTwister rand, ModifiableDataset ds, int rRows,
    324348      IDataset sourceDs, double[] curTarget, string targetVarName, IEnumerable<int> trainingIndices) {
     
    374398        prob.ProblemDataParameter.Value = problemData;
    375399        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;
    388401    }
    389402
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj

    r13646 r13653  
    322322      <Private>False</Private>
    323323    </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>
    324328    <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
    325329      <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
     
    420424      <Name>HeuristicLab.Random-3.3</Name>
    421425      <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>
    422430    </ProjectReference>
    423431  </ItemGroup>
Note: See TracChangeset for help on using the changeset viewer.