Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/16/09 13:13:52 (15 years ago)
Author:
gkronber
Message:

Fixed problems with classification algorithms. #746 (CEDMA server is not compatible with new data-modeling algorithms)

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

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/DefaultStructureIdentificationOperators.cs

    r2362 r2363  
    156156
    157157    public static void PopulateAnalyzerModel(IScope bestModelScope, IAnalyzerModel model) {
    158       model.SetMetaData("EvaluatedSolutions", bestModelScope.GetVariableValue<DoubleData>("EvaluatedSolutions", false).Data);
     158      model.SetMetaData("EvaluatedSolutions", bestModelScope.GetVariableValue<IntData>("EvaluatedSolutions", false).Data);
    159159      IGeneticProgrammingModel gpModel = bestModelScope.GetVariableValue<IGeneticProgrammingModel>("FunctionTree", false);
    160160      model.SetMetaData("TreeSize", gpModel.Size);
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGPRegression.cs

    r2362 r2363  
    3434
    3535namespace HeuristicLab.GP.StructureIdentification {
    36   public class OffspringSelectionGPRegression : HeuristicLab.GP.Algorithms.OffspringSelectionGP, IAlgorithm {
     36  public class OffspringSelectionGPRegression : HeuristicLab.GP.Algorithms.OffspringSelectionGP, IStochasticAlgorithm {
    3737    public override string Name { get { return "OffspringSelectionGP - StructureIdentification"; } }
    3838
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGPRegression.cs

    r2362 r2363  
    3333
    3434namespace HeuristicLab.GP.StructureIdentification {
    35   public class StandardGPRegression : HeuristicLab.GP.Algorithms.StandardGP, IAlgorithm {
     35  public class StandardGPRegression : HeuristicLab.GP.Algorithms.StandardGP, IStochasticAlgorithm {
    3636
    3737    public override string Name { get { return "StandardGP - StructureIdentification"; } }
     
    9696
    9797    protected override IOperator CreateGenerationStepHook() {
    98       return DefaultStructureIdentificationOperators.CreateGenerationStepHook();
     98      IOperator op = DefaultStructureIdentificationOperators.CreateGenerationStepHook();
     99      op.AddSubOperator(CreateBestSolutionProcessor());
     100      return op;
    99101    }
     102
     103    private IOperator CreateBestSolutionProcessor() {
     104      CombinedOperator op = new CombinedOperator();
     105      op.Name = "BestSolutionProcessor";
     106      SequentialProcessor seq = new SequentialProcessor();
     107
     108      ProgrammableOperator evaluatedSolutionsStorer = new ProgrammableOperator();
     109      evaluatedSolutionsStorer.RemoveVariableInfo("Result");
     110      evaluatedSolutionsStorer.AddVariableInfo(new VariableInfo("Input", "Value to copy", typeof(IntData), VariableKind.In));
     111      evaluatedSolutionsStorer.AddVariableInfo(new VariableInfo("Output", "Value to write", typeof(IntData), VariableKind.New));
     112      evaluatedSolutionsStorer.GetVariableInfo("Input").ActualName = "EvaluatedSolutions";
     113      evaluatedSolutionsStorer.GetVariableInfo("Output").ActualName = "EvaluatedSolutions";
     114      evaluatedSolutionsStorer.Code = "Output.Data = Input.Data;";
     115
     116      seq.AddSubOperator(evaluatedSolutionsStorer);
     117
     118      op.OperatorGraph.AddOperator(seq);
     119      op.OperatorGraph.InitialOperator = seq;
     120      return op;
     121    }
     122
    100123
    101124    protected override VariableInjector CreateGlobalInjector() {
     
    150173    }
    151174
    152     private IOperator CreateBestSolutionProcessor() {
    153       CombinedOperator op = new CombinedOperator();
    154       op.Name = "BestSolutionProcessor";
    155       SequentialProcessor seq = new SequentialProcessor();
    156 
    157       ProgrammableOperator evaluatedSolutionsStorer = new ProgrammableOperator();
    158       evaluatedSolutionsStorer.RemoveVariableInfo("Result");
    159       evaluatedSolutionsStorer.AddVariableInfo(new VariableInfo("Input", "Value to copy", typeof(IntData), VariableKind.In));
    160       evaluatedSolutionsStorer.AddVariableInfo(new VariableInfo("Output", "Value to write", typeof(IntData), VariableKind.New));
    161       evaluatedSolutionsStorer.GetVariableInfo("Input").ActualName = "EvaluatedSolutions";
    162       evaluatedSolutionsStorer.GetVariableInfo("Output").ActualName = "EvaluatedSolutions";
    163       evaluatedSolutionsStorer.Code = "Output.Data = Input.Data;";
    164 
    165       seq.AddSubOperator(evaluatedSolutionsStorer);
    166 
    167       op.OperatorGraph.AddOperator(seq);
    168       op.OperatorGraph.InitialOperator = seq;
    169       return op;
    170     }
    171 
    172 
    173175    protected virtual IOperator CreateModelAnalyzerOperator() {
    174176      return DefaultRegressionOperators.CreatePostProcessingOperator();
Note: See TracChangeset for help on using the changeset viewer.