Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/06/09 14:41:27 (15 years ago)
Author:
gkronber
Message:

Added more result values to be stored into the CEDMA db for each experiment. #419 (Refactor CEDMA plugins)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/DispatcherBase.cs

    r1266 r1275  
    4949    };
    5050
     51    private static int MaxGenerations {
     52      get { return 3; }
     53    }
     54
     55    private static int MaxEvaluatedSolutions {
     56      get { return 3000; }
     57    }
     58
    5159    public DispatcherBase(IStore store) {
    5260      this.store = store;
     
    7078      DataSet dataSet = new DataSet(store, dataSetEntity);
    7179
    72       int targetVariable = SelectTargetVariable(dataSet, dataSet.Problem.AllowedInputVariables.ToArray());
     80      int targetVariable = SelectTargetVariable(dataSet, dataSet.Problem.AllowedTargetVariables.ToArray());
    7381      Algorithm selectedAlgorithm = SelectAlgorithm(dataSet, targetVariable, possibleAlgorithms[dataSet.Problem.LearningTask]);
    7482      string targetVariableName = dataSet.Problem.GetVariableName(targetVariable);
     
    92100        case Algorithm.StandardGpRegression: {
    93101            var algo = new HeuristicLab.GP.StructureIdentification.StandardGP();
    94             SetGpParameters(algo, complexity);
    95             SetProblemParameters(algo, problem, targetVariable);
    96             algo.MaxGenerations = 2;
     102            SetComplexityParameters(algo, complexity);
     103            SetProblemParameters(algo, problem, targetVariable);
     104            algo.PopulationSize = 10000;
     105            algo.MaxGenerations = MaxGenerations;
    97106            Execution exec = new Execution(algo.Engine);
    98107            exec.Description = "StandardGP - Complexity: " + complexity;
     
    101110        case Algorithm.OffspringGpRegression: {
    102111            var algo = new HeuristicLab.GP.StructureIdentification.OffspringSelectionGP();
    103             SetGpParameters(algo, complexity);
    104             SetProblemParameters(algo, problem, targetVariable);
    105             algo.MaxEvaluatedSolutions = 10000;
     112            SetComplexityParameters(algo, complexity);
     113            SetProblemParameters(algo, problem, targetVariable);
     114            algo.MaxEvaluatedSolutions = MaxEvaluatedSolutions;
    106115            Execution exec = new Execution(algo.Engine);
    107116            exec.Description = "OffspringGP - Complexity: " + complexity;
     
    110119        case Algorithm.StandardGpClassification: {
    111120            var algo = new HeuristicLab.GP.StructureIdentification.Classification.StandardGP();
    112             SetGpParameters(algo, complexity);
    113             SetProblemParameters(algo, problem, targetVariable);
    114             algo.MaxGenerations = 2;
     121            SetComplexityParameters(algo, complexity);
     122            SetProblemParameters(algo, problem, targetVariable);
     123            algo.PopulationSize = 10000;
     124            algo.MaxGenerations = MaxGenerations;
    115125            Execution exec = new Execution(algo.Engine);
    116126            exec.Description = "StandardGP - Complexity: " + complexity;
     
    119129        case Algorithm.OffspringGpClassification: {
    120130            var algo = new HeuristicLab.GP.StructureIdentification.Classification.OffspringSelectionGP();
    121             SetGpParameters(algo, complexity);
    122             SetProblemParameters(algo, problem, targetVariable);
    123             algo.MaxEvaluatedSolutions = 10000;
     131            SetComplexityParameters(algo, complexity);
     132            SetProblemParameters(algo, problem, targetVariable);
     133            algo.MaxEvaluatedSolutions = MaxEvaluatedSolutions;
    124134            Execution exec = new Execution(algo.Engine);
    125135            exec.Description = "OffspringGP - Complexity: " + complexity;
     
    128138        case Algorithm.StandardGpForecasting: {
    129139            var algo = new HeuristicLab.GP.StructureIdentification.TimeSeries.StandardGP();
    130             SetGpParameters(algo, complexity);
    131             SetProblemParameters(algo, problem, targetVariable);
    132             algo.MaxGenerations = 2;
     140            SetComplexityParameters(algo, complexity);
     141            SetProblemParameters(algo, problem, targetVariable);
     142            algo.PopulationSize = 10000;
     143            algo.MaxGenerations = MaxGenerations;
    133144            Execution exec = new Execution(algo.Engine);
    134145            exec.Description = "StandardGP - Complexity: " + complexity;
     
    137148        case Algorithm.OffspringGpForecasting: {
    138149            var algo = new HeuristicLab.GP.StructureIdentification.TimeSeries.OffspringSelectionGP();
    139             SetGpParameters(algo, complexity);
    140             SetProblemParameters(algo, problem, targetVariable);
    141             algo.MaxEvaluatedSolutions = 10000;
     150            SetComplexityParameters(algo, complexity);
     151            SetProblemParameters(algo, problem, targetVariable);
     152            algo.MaxEvaluatedSolutions = MaxEvaluatedSolutions;
    142153            Execution exec = new Execution(algo.Engine);
    143154            exec.Description = "OffspringGP - Complexity: " + complexity;
     
    150161    }
    151162
    152     private void SetGpParameters(AlgorithmBase algo, ModelComplexity complexity) {
    153       algo.SetSeedRandomly = true;
    154       algo.PopulationSize = 1000;
    155       algo.Elites = 1;
     163    private void SetComplexityParameters(AlgorithmBase algo, ModelComplexity complexity) {
    156164      switch (complexity) {
    157165        case ModelComplexity.Low: {
     
    196204
    197205    private IEnumerable<double> GetDifferentClassValues(HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable) {
    198       throw new NotImplementedException();
     206      return Enumerable.Range(0, dataset.Rows).Select(x => dataset.GetValue(x, targetVariable)).Distinct();
    199207    }
    200208  }
Note: See TracChangeset for help on using the changeset viewer.