Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/03/09 12:26:42 (15 years ago)
Author:
gkronber
Message:

Merged changes from GP-refactoring branch back into the trunk #713.

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

Legend:

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

    r2136 r2222  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Core;
    27 using HeuristicLab.Data;
    28 using HeuristicLab.Operators;
    2923using HeuristicLab.Modeling;
    3024
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/EarlyStoppingMeanSquaredErrorEvaluator.cs

    r2034 r2222  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    2622using HeuristicLab.Core;
    2723using HeuristicLab.Data;
    28 using HeuristicLab.Operators;
    2924
    3025namespace HeuristicLab.GP.StructureIdentification {
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/GPEvaluatorBase.cs

    r2130 r2222  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    2622using HeuristicLab.Core;
    2723using HeuristicLab.Data;
    28 using HeuristicLab.Operators;
    2924using HeuristicLab.DataAnalysis;
     25using HeuristicLab.GP.Interfaces;
    3026
    3127namespace HeuristicLab.GP.StructureIdentification {
     
    3430      : base() {
    3531      AddVariableInfo(new VariableInfo("TreeEvaluator", "The evaluator that should be used to evaluate the expression tree", typeof(ITreeEvaluator), VariableKind.In));
    36       AddVariableInfo(new VariableInfo("FunctionTree", "The function tree that should be evaluated", typeof(IFunctionTree), VariableKind.In));
    37       AddVariableInfo(new VariableInfo("TreeSize", "Size (number of nodes) of the tree to evaluate", typeof(IntData), VariableKind.In));
     32      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree that should be evaluated", typeof(IGeneticProgrammingModel), VariableKind.In));
    3833      AddVariableInfo(new VariableInfo("Dataset", "Dataset with all samples on which to apply the function", typeof(Dataset), VariableKind.In));
    3934      AddVariableInfo(new VariableInfo("TargetVariable", "Index of the column of the dataset that holds the target variable", typeof(IntData), VariableKind.In));
     
    5146      int targetVariable = GetVariableValue<IntData>("TargetVariable", scope, true).Data;
    5247      Dataset dataset = GetVariableValue<Dataset>("Dataset", scope, true);
    53       IFunctionTree functionTree = GetVariableValue<IFunctionTree>("FunctionTree", scope, true);
     48      IGeneticProgrammingModel gpModel = GetVariableValue<IGeneticProgrammingModel>("FunctionTree", scope, true);
    5449      double punishmentFactor = GetVariableValue<DoubleData>("PunishmentFactor", scope, true).Data;
    55       int treeSize = scope.GetVariableValue<IntData>("TreeSize", true).Data;
    5650      double totalEvaluatedNodes = scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data;
    5751      int trainingStart = GetVariableValue<IntData>("TrainingSamplesStart", scope, true).Data;
     
    6155      bool useEstimatedValues = GetVariableValue<BoolData>("UseEstimatedTargetValue", scope, true).Data;
    6256      ITreeEvaluator evaluator = GetVariableValue<ITreeEvaluator>("TreeEvaluator", scope, true);
    63       evaluator.PrepareForEvaluation(dataset, targetVariable, trainingStart, trainingEnd, punishmentFactor, functionTree);
     57      evaluator.PrepareForEvaluation(dataset, targetVariable, trainingStart, trainingEnd, punishmentFactor, gpModel.FunctionTree);
    6458
    6559      double[] backupValues = null;
     
    8680
    8781      // update the value of total evaluated nodes
    88       scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data = totalEvaluatedNodes + treeSize * (end - start);
     82      scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data = totalEvaluatedNodes + gpModel.Size * (end - start);
    8983      return null;
    9084    }
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanAbsolutePercentageErrorEvaluator.cs

    r2136 r2222  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Core;
    27 using HeuristicLab.Data;
    28 using HeuristicLab.Operators;
    2923using HeuristicLab.Modeling;
    30 using HeuristicLab.DataAnalysis;
    3124
    3225namespace HeuristicLab.GP.StructureIdentification {
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanAbsolutePercentageOfRangeErrorEvaluator.cs

    r2136 r2222  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Core;
    27 using HeuristicLab.Data;
    28 using HeuristicLab.Operators;
    2923using HeuristicLab.Modeling;
    30 using HeuristicLab.DataAnalysis;
    3124
    3225namespace HeuristicLab.GP.StructureIdentification {
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanSquaredErrorEvaluator.cs

    r2136 r2222  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Core;
    27 using HeuristicLab.Data;
    28 using HeuristicLab.Operators;
    29 using HeuristicLab.DataAnalysis;
    3023using HeuristicLab.Modeling;
    3124
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleEvaluator.cs

    r2041 r2222  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    2622using HeuristicLab.Core;
    2723using HeuristicLab.Data;
    28 using HeuristicLab.Operators;
    2924using HeuristicLab.DataAnalysis;
    3025
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/SimpleGPEvaluatorBase.cs

    r1894 r2222  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    2622using HeuristicLab.Core;
    2723using HeuristicLab.Data;
    28 using HeuristicLab.Operators;
    2924using HeuristicLab.DataAnalysis;
    3025
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/UncertainMeanSquaredErrorEvaluator.cs

    r2034 r2222  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    2623using HeuristicLab.Core;
    2724using HeuristicLab.Data;
    28 using HeuristicLab.Operators;
    29 using HeuristicLab.DataAnalysis;
    3025using HeuristicLab.Random;
    3126
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/VariableEvaluationImpactCalculator.cs

    r2165 r2222  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    25 using System.Xml;
    2622using HeuristicLab.Core;
    2723using HeuristicLab.Data;
    2824using HeuristicLab.DataAnalysis;
    29 using System.Linq;
     25using HeuristicLab.GP.Interfaces;
    3026
    3127namespace HeuristicLab.GP.StructureIdentification {
     
    3531      : base() {
    3632      AddVariableInfo(new VariableInfo("TreeEvaluator", "The evaluator that should be used to evaluate the expression tree", typeof(ITreeEvaluator), VariableKind.In));
    37       AddVariableInfo(new VariableInfo("FunctionTree", "The function tree that should be evaluated", typeof(IFunctionTree), VariableKind.In));
     33      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree that should be evaluated", typeof(IGeneticProgrammingModel), VariableKind.In));
    3834      AddVariableInfo(new VariableInfo("TreeSize", "Size (number of nodes) of the tree to evaluate", typeof(IntData), VariableKind.In));
    3935      AddVariableInfo(new VariableInfo("PunishmentFactor", "Punishment factor for invalid estimations", typeof(DoubleData), VariableKind.In));
     
    4339    protected override double[] GetOutputs(IScope scope, Dataset dataset, int targetVariable, int start, int end) {
    4440      ITreeEvaluator evaluator = GetVariableValue<ITreeEvaluator>("TreeEvaluator", scope, true);
    45       IFunctionTree tree = GetVariableValue<IFunctionTree>("FunctionTree", scope, true);
     41      IGeneticProgrammingModel gpModel = GetVariableValue<IGeneticProgrammingModel>("FunctionTree", scope, true);
    4642      double punishmentFactor = GetVariableValue<DoubleData>("PunishmentFactor", scope, true).Data;
    47       evaluator.PrepareForEvaluation(dataset, targetVariable, start, end, punishmentFactor, tree);
     43      evaluator.PrepareForEvaluation(dataset, targetVariable, start, end, punishmentFactor, gpModel.FunctionTree);
    4844
    4945      double[] result = new double[end - start];
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/VariableQualityImpactCalculator.cs

    r2165 r2222  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    25 using System.Xml;
    2623using HeuristicLab.Core;
    2724using HeuristicLab.Data;
    2825using HeuristicLab.DataAnalysis;
    29 using System.Linq;
     26using HeuristicLab.GP.Interfaces;
    3027
    3128namespace HeuristicLab.GP.StructureIdentification {
     
    3532      : base() {
    3633      AddVariableInfo(new VariableInfo("TreeEvaluator", "The evaluator that should be used to evaluate the expression tree", typeof(ITreeEvaluator), VariableKind.In));
    37       AddVariableInfo(new VariableInfo("FunctionTree", "The function tree that should be evaluated", typeof(IFunctionTree), VariableKind.In));
     34      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree that should be evaluated", typeof(IGeneticProgrammingModel), VariableKind.In));
    3835      AddVariableInfo(new VariableInfo("TreeSize", "Size (number of nodes) of the tree to evaluate", typeof(IntData), VariableKind.In));
    3936      AddVariableInfo(new VariableInfo("PunishmentFactor", "Punishment factor for invalid estimations", typeof(DoubleData), VariableKind.In));
     
    4239    protected override double CalculateQuality(IScope scope, Dataset dataset, int targetVariable, int start, int end) {
    4340      ITreeEvaluator evaluator = GetVariableValue<ITreeEvaluator>("TreeEvaluator", scope, true);
    44       IFunctionTree tree = GetVariableValue<IFunctionTree>("FunctionTree", scope, true);
     41      IGeneticProgrammingModel gpModel = GetVariableValue<IGeneticProgrammingModel>("FunctionTree", scope, true);
    4542      double punishmentFactor = GetVariableValue<DoubleData>("PunishmentFactor", scope, true).Data;
    46       evaluator.PrepareForEvaluation(dataset, targetVariable, start, end, punishmentFactor, tree);
     43      evaluator.PrepareForEvaluation(dataset, targetVariable, start, end, punishmentFactor, gpModel.FunctionTree);
    4744
    4845      double[,] result = new double[end - start, 2];
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/VarianceAccountedForEvaluator.cs

    r2136 r2222  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    26 using HeuristicLab.Core;
    27 using HeuristicLab.Data;
    28 using HeuristicLab.Operators;
    29 using HeuristicLab.DataAnalysis;
    3023using HeuristicLab.Modeling;
    3124
Note: See TracChangeset for help on using the changeset viewer.