Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/05/09 10:51:26 (16 years ago)
Author:
gkronber
Message:

Improved !StandardGP and !OffspringSelectionGP variants for classification and time-series. #224 (Simple frontend for GP for non-expert users (similar to HeurisicLab.SGA))

Location:
branches/CEDMA-Refactoring-Ticket419
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification.Classification/HeuristicLab.GP.StructureIdentification.Classification.csproj

    r1245 r1251  
    7676    <Compile Include="ROCAnalyzer.cs" />
    7777    <Compile Include="StandardGP.cs" />
     78    <Compile Include="StructIdProblemInjector.cs" />
    7879  </ItemGroup>
    7980  <ItemGroup>
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification.Classification/OffspringSelectionGP.cs

    r1245 r1251  
    3333namespace HeuristicLab.GP.StructureIdentification.Classification {
    3434  public class OffspringSelectionGP : HeuristicLab.GP.StructureIdentification.OffspringSelectionGP {
     35    protected override IOperator CreateProblemInjector() {
     36      return new StructIdProblemInjector();
     37    }
     38
    3539    protected override IOperator CreateBestSolutionProcessor() {
    3640      IOperator seq = base.CreateBestSolutionProcessor();
     
    6872      seq.AddSubOperator(validationAccuracy);
    6973      seq.AddSubOperator(testAccuracy);
     74      seq.AddSubOperator(trainingConfusionMatrix);
     75      seq.AddSubOperator(validationConfusionMatrix);
     76      seq.AddSubOperator(testConfusionMatrix);
    7077      return seq;
    7178    }
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification.Classification/StandardGP.cs

    r1245 r1251  
    3232
    3333namespace HeuristicLab.GP.StructureIdentification.Classification {
    34   public class StandardGP :  HeuristicLab.GP.StructureIdentification.StandardGP {
     34  public class StandardGP : HeuristicLab.GP.StructureIdentification.StandardGP {
     35
     36    protected override IOperator CreateProblemInjector() {
     37      return new StructIdProblemInjector();
     38    }
     39
    3540    protected override IOperator CreateBestSolutionProcessor() {
    3641      IOperator seq = base.CreateBestSolutionProcessor();
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification.TimeSeries/HeuristicLab.GP.StructureIdentification.TimeSeries.csproj

    r1245 r1251  
    7373    <Compile Include="Properties\AssemblyInfo.cs" />
    7474    <Compile Include="StandardGP.cs" />
     75    <Compile Include="StructIdProblemInjector.cs" />
    7576    <Compile Include="TheilInequalityCoefficientEvaluator.cs" />
    7677  </ItemGroup>
     
    99100      <Project>{1F1CF3ED-374C-4288-995B-93F6B872F571}</Project>
    100101      <Name>HeuristicLab.GP</Name>
     102    </ProjectReference>
     103    <ProjectReference Include="..\HeuristicLab.Logging\HeuristicLab.Logging.csproj">
     104      <Project>{4095C92C-5A4C-44BC-9963-5F384CF5CC3F}</Project>
     105      <Name>HeuristicLab.Logging</Name>
    101106    </ProjectReference>
    102107    <ProjectReference Include="..\HeuristicLab.Operators\HeuristicLab.Operators.csproj">
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification.TimeSeries/OffspringSelectionGP.cs

    r1245 r1251  
    3030using HeuristicLab.Data;
    3131using HeuristicLab.Operators;
     32using HeuristicLab.Logging;
    3233
    3334namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
     
    3536    protected override IOperator CreateFunctionLibraryInjector() {
    3637      return new FunctionLibraryInjector();
     38    }
     39
     40    protected override IOperator CreateProblemInjector() {
     41      return new StructIdProblemInjector();
     42    }
     43
     44    protected override IOperator CreateGlobalInjector() {
     45      VariableInjector injector = (VariableInjector)base.CreateGlobalInjector();
     46      injector.AddVariable(new HeuristicLab.Core.Variable("Autoregressive", new BoolData(false)));
     47      return injector;
    3748    }
    3849
     
    6374      testTheil.GetVariableInfo("TheilInequalityCoefficientCovariance").ActualName = "TestTheilInequalityCoefficientCovariance";
    6475
     76      SimpleEvaluator trainingEvaluator = new SimpleEvaluator();
     77      trainingEvaluator.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
     78      trainingEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
     79      trainingEvaluator.GetVariableInfo("Values").ActualName = "PredictedValuesTraining";
     80
     81      SimpleEvaluator validationEvaluator = new SimpleEvaluator();
     82      validationEvaluator.GetVariableInfo("SamplesStart").ActualName = "ValidationSamplesStart";
     83      validationEvaluator.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";
     84      validationEvaluator.GetVariableInfo("Values").ActualName = "PredictedValuesValidation";
     85     
     86      SimpleEvaluator testEvaluator = new SimpleEvaluator();
     87      testEvaluator.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
     88      testEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
     89      testEvaluator.GetVariableInfo("Values").ActualName = "PredictedValuesTest";
     90
     91      LinechartInjector trainingChartInjector = new LinechartInjector();
     92      trainingChartInjector.GetVariableValue<IntData>("NumberOfLines", null, false).Data = 2;
     93      trainingChartInjector.GetVariableInfo("Values").ActualName = "PredictedValuesTraining";
     94      trainingChartInjector.GetVariableInfo("Linechart").ActualName = "LinechartTrainingPredictedValues";
     95
     96      LinechartInjector validationChartInjector = new LinechartInjector();
     97      validationChartInjector.GetVariableValue<IntData>("NumberOfLines", null, false).Data = 2;
     98      validationChartInjector.GetVariableInfo("Values").ActualName = "PredictedValuesValidation";
     99      validationChartInjector.GetVariableInfo("Linechart").ActualName = "LinechartValidationPredictedValues";
     100
     101      LinechartInjector testChartInjector = new LinechartInjector();
     102      testChartInjector.GetVariableValue<IntData>("NumberOfLines", null, false).Data = 2;
     103      testChartInjector.GetVariableInfo("Values").ActualName = "PredictedValuesTest";
     104      testChartInjector.GetVariableInfo("Linechart").ActualName = "LinechartTestPredictedValues";
     105
    65106      seq.AddSubOperator(trainingTheil);
    66107      seq.AddSubOperator(validationTheil);
    67108      seq.AddSubOperator(testTheil);
     109      seq.AddSubOperator(trainingEvaluator);
     110      seq.AddSubOperator(trainingChartInjector);
     111      seq.AddSubOperator(validationEvaluator);
     112      seq.AddSubOperator(validationChartInjector);
     113      seq.AddSubOperator(testEvaluator);
     114      seq.AddSubOperator(testChartInjector);
    68115
    69116      return seq;
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification.TimeSeries/StandardGP.cs

    r1245 r1251  
    2929using HeuristicLab.DataAnalysis;
    3030using HeuristicLab.Data;
     31using HeuristicLab.Operators;
     32using HeuristicLab.Logging;
    3133
    3234namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
     
    3436    protected override IOperator CreateFunctionLibraryInjector() {
    3537      return new FunctionLibraryInjector();
     38    }
     39
     40    protected override IOperator CreateProblemInjector() {
     41      return new StructIdProblemInjector();
     42    }
     43
     44    protected override IOperator CreateGlobalInjector() {
     45      VariableInjector injector = (VariableInjector)base.CreateGlobalInjector();
     46      injector.AddVariable(new HeuristicLab.Core.Variable("Autoregressive", new BoolData(false)));
     47      return injector;
    3648    }
    3749
     
    6274      testTheil.GetVariableInfo("TheilInequalityCoefficientCovariance").ActualName = "TestTheilInequalityCoefficientCovariance";
    6375
     76      SimpleEvaluator trainingEvaluator = new SimpleEvaluator();
     77      trainingEvaluator.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
     78      trainingEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
     79      trainingEvaluator.GetVariableInfo("Values").ActualName = "PredictedValuesTraining";
     80
     81      SimpleEvaluator validationEvaluator = new SimpleEvaluator();
     82      validationEvaluator.GetVariableInfo("SamplesStart").ActualName = "ValidationSamplesStart";
     83      validationEvaluator.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";
     84      validationEvaluator.GetVariableInfo("Values").ActualName = "PredictedValuesValidation";
     85
     86      SimpleEvaluator testEvaluator = new SimpleEvaluator();
     87      testEvaluator.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
     88      testEvaluator.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
     89      testEvaluator.GetVariableInfo("Values").ActualName = "PredictedValuesTest";
     90
     91      LinechartInjector trainingChartInjector = new LinechartInjector();
     92      trainingChartInjector.GetVariableValue<IntData>("NumberOfLines", null, false).Data = 2;
     93      trainingChartInjector.GetVariableInfo("Values").ActualName = "PredictedValuesTraining";
     94      trainingChartInjector.GetVariableInfo("LineChart").ActualName = "LineChartTrainingPredictedValues";
     95
     96      LinechartInjector validationChartInjector = new LinechartInjector();
     97      validationChartInjector.GetVariableValue<IntData>("NumberOfLines", null, false).Data = 2;
     98      validationChartInjector.GetVariableInfo("Values").ActualName = "PredictedValuesValidation";
     99      validationChartInjector.GetVariableInfo("LineChart").ActualName = "LineChartValidationPredictedValues";
     100
     101      LinechartInjector testChartInjector = new LinechartInjector();
     102      testChartInjector.GetVariableValue<IntData>("NumberOfLines", null, false).Data = 2;
     103      testChartInjector.GetVariableInfo("Values").ActualName = "PredictedValuesTest";
     104      testChartInjector.GetVariableInfo("LineChart").ActualName = "LineChartTestPredictedValues";
     105
    64106      seq.AddSubOperator(trainingTheil);
    65107      seq.AddSubOperator(validationTheil);
    66108      seq.AddSubOperator(testTheil);
     109      seq.AddSubOperator(trainingEvaluator);
     110      seq.AddSubOperator(trainingChartInjector);
     111      seq.AddSubOperator(validationEvaluator);
     112      seq.AddSubOperator(validationChartInjector);
     113      seq.AddSubOperator(testEvaluator);
     114      seq.AddSubOperator(testChartInjector);
    67115
    68116      return seq;
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification/AlgorithmBase.cs

    r1245 r1251  
    116116      algo.Name = "GP";
    117117      SequentialProcessor seq = new SequentialProcessor();
    118       EmptyOperator problemInjectorPlaceholder = new EmptyOperator();
     118      IOperator problemInjector = CreateProblemInjector();
    119119
    120120      RandomInjector randomInjector = new RandomInjector();
     
    143143      LeftReducer cleanUp = new LeftReducer();
    144144
    145       seq.AddSubOperator(problemInjectorPlaceholder);
     145      seq.AddSubOperator(problemInjector);
    146146      seq.AddSubOperator(randomInjector);
    147147      seq.AddSubOperator(globalInjector);
     
    162162      this.algorithm = seq;
    163163      return algo;
     164    }
     165
     166    protected internal virtual IOperator CreateProblemInjector() {
     167      return new EmptyOperator();
    164168    }
    165169
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification/StandardGP.cs

    r1245 r1251  
    8787      Engine.OperatorGraph.AddOperator(algo);
    8888      Engine.OperatorGraph.InitialOperator = algo;
     89    }
     90
     91    protected internal override IOperator CreateProblemInjector() {
     92      return new StructIdProblemInjector();
    8993    }
    9094
Note: See TracChangeset for help on using the changeset viewer.