Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/22/08 18:05:14 (17 years ago)
Author:
gkronber
Message:

merged FunctionsAndStructIdRefactoring-branch (r142, r143, r144, r145, r146, r147, r148, r149, r152, r153) back into the trunk (ticket #112)

Location:
trunk/sources/HeuristicLab.StructureIdentification/Evaluation
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/CoefficientOfDeterminationEvaluator.cs

    r128 r155  
    3434    public override string Description {
    3535      get {
    36         return @"Applies 'OperatorTree' to all samples of 'Dataset' and calculates
     36        return @"Evaluates 'FunctionTree' for all samples of 'Dataset' and calculates
    3737the 'coefficient of determination' of estimated values vs. real values of 'TargetVariable'.";
    3838      }
     
    4343    }
    4444
    45     public override double Evaluate(IScope scope, IFunction function, int targetVariable, Dataset dataset) {
     45    public override double Evaluate(IScope scope, IFunctionTree functionTree, int targetVariable, Dataset dataset) {
    4646      double errorsSquaredSum = 0.0;
    4747      double originalDeviationTotalSumOfSquares = 0.0;
    4848      double targetMean = dataset.GetMean(targetVariable);
    4949      for(int sample = 0; sample < dataset.Rows; sample++) {
    50         double estimated = function.Evaluate(dataset, sample);
     50        double estimated = functionTree.Evaluate(dataset, sample);
    5151        double original = dataset.GetValue(sample, targetVariable);
    5252        if(!double.IsNaN(original) && !double.IsInfinity(original)) {
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/EarlyStoppingMeanSquaredErrorEvaluator.cs

    r136 r155  
    3434    public override string Description {
    3535      get {
    36         return @"Evaluates 'OperatorTree' for all samples of the dataset and calculates the mean-squared-error
     36        return @"Evaluates 'FunctionTree' for all samples of the dataset and calculates the mean-squared-error
    3737for the estimated values vs. the real values of 'TargetVariable'.
    3838This operator stops the computation as soon as an upper limit for the mean-squared-error is reached.";
     
    4545    }
    4646
    47     public override double Evaluate(IScope scope, IFunction function, int targetVariable, Dataset dataset) {
     47    public override double Evaluate(IScope scope, IFunctionTree functionTree, int targetVariable, Dataset dataset) {
    4848      double qualityLimit = GetVariableValue<DoubleData>("QualityLimit", scope, false).Data;
    4949      double errorsSquaredSum = 0;
    5050      double targetMean = dataset.GetMean(targetVariable);
    5151      for(int sample = 0; sample < dataset.Rows; sample++) {
    52         double estimated = function.Evaluate(dataset, sample);
     52        double estimated = functionTree.Evaluate(dataset, sample);
    5353        double original = dataset.GetValue(sample, targetVariable);
    5454        if(double.IsNaN(estimated) || double.IsInfinity(estimated)) {
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/GPEvaluatorBase.cs

    r135 r155  
    3636    public GPEvaluatorBase()
    3737      : base() {
    38       AddVariableInfo(new VariableInfo("OperatorTree", "The function tree that should be evaluated", typeof(IFunction), VariableKind.In));
     38      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree that should be evaluated", typeof(IFunctionTree), VariableKind.In));
    3939      AddVariableInfo(new VariableInfo("Dataset", "Dataset with all samples on which to apply the function", typeof(Dataset), VariableKind.In));
    4040      AddVariableInfo(new VariableInfo("TargetVariable", "Index of the column of the dataset that holds the target variable", typeof(IntData), VariableKind.In));
     
    4646      int targetVariable = GetVariableValue<IntData>("TargetVariable", scope, true).Data;
    4747      Dataset dataset = GetVariableValue<Dataset>("Dataset", scope, true);
    48       IFunction function = GetVariableValue<IFunction>("OperatorTree", scope, true);
     48      IFunctionTree functionTree = GetVariableValue<IFunctionTree>("FunctionTree", scope, true);
    4949      this.maximumPunishment = GetVariableValue<DoubleData>("PunishmentFactor", scope, true).Data * dataset.GetRange(targetVariable);
    5050
    51       double result = Evaluate(scope, function, targetVariable, dataset);
     51      double result = Evaluate(scope, functionTree, targetVariable, dataset);
    5252      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("Quality"), new DoubleData(result)));
    5353      return null;
    5454    }
    5555
    56     public abstract double Evaluate(IScope scope, IFunction function, int targetVariable, Dataset dataset);
     56    public abstract double Evaluate(IScope scope, IFunctionTree functionTree, int targetVariable, Dataset dataset);
    5757  }
    5858}
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MeanSquaredErrorEvaluator.cs

    r128 r155  
    3434    public override string Description {
    3535      get {
    36         return @"Evaluates 'OperatorTree' for all samples of 'DataSet' and calculates the mean-squared-error
     36        return @"Evaluates 'FunctionTree' for all samples of 'DataSet' and calculates the mean-squared-error
    3737for the estimated values vs. the real values of 'TargetVariable'.";
    3838      }
     
    4343    }
    4444
    45     public override double Evaluate(IScope scope, IFunction function, int targetVariable, Dataset dataset) {
     45    public override double Evaluate(IScope scope, IFunctionTree functionTree, int targetVariable, Dataset dataset) {
    4646      double errorsSquaredSum = 0;
    4747      double targetMean = dataset.GetMean(targetVariable);
    4848      for(int sample = 0; sample < dataset.Rows; sample++) {
    49         double estimated = function.Evaluate(dataset, sample);
     49
     50        double estimated = functionTree.Evaluate(dataset, sample);
    5051        double original = dataset.GetValue(sample, targetVariable);
    5152        if(double.IsNaN(estimated) || double.IsInfinity(estimated)) {
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/VarianceAccountedForEvaluator.cs

    r128 r155  
    3434    public override string Description {
    3535      get {
    36         return @"Evaluates 'OperatorTree' for all samples of 'DataSet' and calculates
     36        return @"Evaluates 'FunctionTree' for all samples of 'DataSet' and calculates
    3737the variance-accounted-for quality measure for the estimated values vs. the real values of 'TargetVariable'.
    3838
     
    5353
    5454
    55     public override double Evaluate(IScope scope, IFunction function, int targetVariable, Dataset dataset) {
     55    public override double Evaluate(IScope scope, IFunctionTree functionTree, int targetVariable, Dataset dataset) {
    5656      double[] errors = new double[dataset.Rows];
    5757      double[] originalTargetVariableValues = new double[dataset.Rows];
    5858      double targetMean = dataset.GetMean(targetVariable);
    5959      for(int sample = 0; sample < dataset.Rows; sample++) {
    60         double estimated = function.Evaluate(dataset, sample);
     60        double estimated = functionTree.Evaluate(dataset, sample);
    6161        double original = dataset.GetValue(sample, targetVariable);
    6262        if(!double.IsNaN(original) && !double.IsInfinity(original)) {
Note: See TracChangeset for help on using the changeset viewer.