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.TimeSeries/3.3
Files:
3 edited

Legend:

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

    r2352 r2356  
    8383  <ItemGroup>
    8484    <Compile Include="AveragePercentageChangeEvaluator.cs" />
    85     <Compile Include="DefaultTimeSeriesOperators.cs" />
    8685    <Compile Include="HeuristicLabGPTimeSeriesPlugin.cs" />
    8786    <Compile Include="OffspringSelectionGP.cs" />
  • trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/OffspringSelectionGP.cs

    r2344 r2356  
    2929namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
    3030  public class OffspringSelectionGP : HeuristicLab.GP.StructureIdentification.OffspringSelectionGP, ITimeSeriesAlgorithm {
     31    public override string Name {
     32      get {
     33        return base.Name + " - time series prognosis";
     34      }
     35    }
    3136
    3237    public int MinTimeOffset {
     
    5055
    5156    protected override IOperator CreateFunctionLibraryInjector() {
    52       return DefaultTimeSeriesOperators.CreateFunctionLibraryInjector();
    53     }
    54 
    55     protected override IOperator CreatePostProcessingOperator() {
    56       return DefaultTimeSeriesOperators.CreatePostProcessingOperator();
     57      CombinedOperator op = new CombinedOperator();
     58      op.Name = "FunctionLibraryInjector";
     59      SequentialProcessor seq = new SequentialProcessor();
     60      FunctionLibraryInjector funLibInjector = new FunctionLibraryInjector();
     61      funLibInjector.GetVariable("Differentials").Value = new BoolData(true);
     62      seq.AddSubOperator(funLibInjector);
     63      seq.AddSubOperator(new HL3TreeEvaluatorInjector());
     64      op.OperatorGraph.AddOperator(seq);
     65      op.OperatorGraph.InitialOperator = seq;
     66      return op;
    5767    }
    5868
     
    6575    }
    6676
     77    protected override IOperator CreateModelAnalyzerOperator() {
     78      return DefaultTimeSeriesOperators.CreatePostProcessingOperator();
     79    }
     80
    6781    protected override IAnalyzerModel CreateGPModel() {
    68       IAnalyzerModel model = base.CreateGPModel();
    69       DefaultTimeSeriesOperators.SetModelData(model, Engine.GlobalScope.SubScopes[0]);
     82      var model = new AnalyzerModel();
     83      var bestModelScope = Engine.GlobalScope.SubScopes[0];
     84      model.SetMetaData("SelectionPressure", bestModelScope.GetVariableValue<DoubleData>("SelectionPressure", false).Data);
     85      DefaultStructureIdentificationOperators.PopulateAnalyzerModel(bestModelScope, model);
     86      DefaultTimeSeriesOperators.PopulateAnalyzerModel(bestModelScope, model);
    7087      return model;
    7188    }
  • trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/StandardGP.cs

    r2344 r2356  
    2929namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
    3030  public class StandardGP : HeuristicLab.GP.StructureIdentification.StandardGP, ITimeSeriesAlgorithm {
     31    public override string Name {
     32      get {
     33        return base.Name + " - time series prognosis";
     34      }
     35    }
     36
    3137    public int MinTimeOffset {
    3238      get { return GetVariableInjector().GetVariable("MinTimeOffset").GetValue<IntData>().Data; }
     
    4955
    5056    protected override IOperator CreateFunctionLibraryInjector() {
    51       return DefaultTimeSeriesOperators.CreateFunctionLibraryInjector();
     57      CombinedOperator op = new CombinedOperator();
     58      op.Name = "FunctionLibraryInjector";
     59      SequentialProcessor seq = new SequentialProcessor();
     60      FunctionLibraryInjector funLibInjector = new FunctionLibraryInjector();
     61      funLibInjector.GetVariable("Differentials").Value = new BoolData(true);
     62      seq.AddSubOperator(funLibInjector);
     63      seq.AddSubOperator(new HL3TreeEvaluatorInjector());
     64      op.OperatorGraph.AddOperator(seq);
     65      op.OperatorGraph.InitialOperator = seq;
     66      return op;
    5267    }
    5368
    54     protected override IOperator CreatePostProcessingOperator() {
     69    protected override IOperator CreateModelAnalyzerOperator() {
    5570      return DefaultTimeSeriesOperators.CreatePostProcessingOperator();
    5671    }
     
    6580
    6681    protected override IAnalyzerModel CreateGPModel() {
    67       IAnalyzerModel model = base.CreateGPModel();
    68       DefaultTimeSeriesOperators.SetModelData(model, Engine.GlobalScope.SubScopes[0]);
     82      var model = new AnalyzerModel();
     83      var bestModelScope = Engine.GlobalScope.SubScopes[0];
     84      DefaultStructureIdentificationOperators.PopulateAnalyzerModel(bestModelScope, model);
     85      DefaultTimeSeriesOperators.PopulateAnalyzerModel(bestModelScope, model);
    6986      return model;
    7087    }
Note: See TracChangeset for help on using the changeset viewer.