Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/15/09 14:01:47 (15 years ago)
Author:
gkronber
Message:

Moved common (not algorithm specific) model analyzer code (same operator tree in all regression/classification/time-series-prognosis engines) to HL.Modeling. #625, #705, #739.

Location:
trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/HeuristicLab.GP.StructureIdentification.Classification-3.3.csproj

    r2351 r2356  
    8181  <ItemGroup>
    8282    <Compile Include="ClassificationMeanSquaredErrorEvaluator.cs" />
    83     <Compile Include="DefaultClassificationAlgorithmOperators.cs" />
    8483    <Compile Include="GPClassificationEvaluatorBase.cs" />
    8584    <Compile Include="CrossValidation.cs" />
  • trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/OffspringSelectionGP.cs

    r2344 r2356  
    2323using HeuristicLab.Modeling;
    2424using HeuristicLab.Operators;
     25using HeuristicLab.Data;
    2526
    2627namespace HeuristicLab.GP.StructureIdentification.Classification {
    2728  public class OffspringSelectionGP : HeuristicLab.GP.StructureIdentification.OffspringSelectionGP, IClassificationAlgorithm {
    2829
    29     protected override IOperator CreateProblemInjector() {
    30       return DefaultClassificationAlgorithmOperators.CreateProblemInjector();
     30    public override string Name {
     31      get {
     32        return base.Name + " - Classification";
     33      }
    3134    }
    3235
    33     protected override IOperator CreatePostProcessingOperator() {
    34       return DefaultClassificationAlgorithmOperators.CreatePostProcessingOperator();
     36    protected override IOperator CreateProblemInjector() {
     37      return DefaultClassificationOperators.CreateProblemInjector();
    3538    }
    3639
    37     protected override IAnalyzerModel CreateGPModel() {
    38       IAnalyzerModel model = base.CreateGPModel();
    39       DefaultClassificationAlgorithmOperators.SetModelData(model, Engine.GlobalScope.SubScopes[0]);
     40    protected override IOperator CreateModelAnalyzerOperator() {
     41      return DefaultClassificationOperators.CreatePostProcessingOperator();
     42    }
     43
     44    protected virtual IAnalyzerModel CreateGPModel() {
     45      IScope bestModelScope = Engine.GlobalScope.SubScopes[0];
     46      var model = new AnalyzerModel();
     47
     48      model.SetMetaData("SelectionPressure", bestModelScope.GetVariableValue<DoubleData>("SelectionPressure", false).Data);
     49      DefaultStructureIdentificationOperators.PopulateAnalyzerModel(bestModelScope, model);
     50      DefaultClassificationOperators.PopulateAnalyzerModel(bestModelScope, model);
     51
    4052      return model;
    4153    }
  • trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/StandardGP.cs

    r2344 r2356  
    2727namespace HeuristicLab.GP.StructureIdentification.Classification {
    2828  public class StandardGP : HeuristicLab.GP.StructureIdentification.StandardGP, IClassificationAlgorithm {
     29    public override string Name {
     30      get {
     31        return base.Name + " - Classification";
     32      }
     33    }
     34
    2935    protected override IOperator CreateProblemInjector() {
    30       return DefaultClassificationAlgorithmOperators.CreateProblemInjector();
     36      return DefaultClassificationOperators.CreateProblemInjector();
    3137    }
    32    
    33     protected override IOperator CreatePostProcessingOperator() {
    34       return DefaultClassificationAlgorithmOperators.CreatePostProcessingOperator();
     38
     39    protected override IOperator CreateModelAnalyzerOperator() {
     40      return DefaultClassificationOperators.CreatePostProcessingOperator();
    3541    }
    3642
    3743    protected override IAnalyzerModel CreateGPModel() {
    38       IAnalyzerModel model = base.CreateGPModel();
    39       DefaultClassificationAlgorithmOperators.SetModelData(model, Engine.GlobalScope.SubScopes[0]);
     44      var model = new AnalyzerModel();
     45      var bestModelScope = Engine.GlobalScope.SubScopes[0];
     46      DefaultStructureIdentificationOperators.PopulateAnalyzerModel(bestModelScope, model);
     47      DefaultClassificationOperators.PopulateAnalyzerModel(bestModelScope, model);
    4048      return model;
    4149    }
Note: See TracChangeset for help on using the changeset viewer.