Free cookie consent management tool by TermsFeed Policy Generator

Changeset 137


Ignore:
Timestamp:
04/19/08 15:36:02 (17 years ago)
Author:
gkronber
Message:

merged bugfixes from r135 and r136 from the trunk into the 3.0 branch

Location:
branches/3.0/sources/HeuristicLab.StructureIdentification/Evaluation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/sources/HeuristicLab.StructureIdentification/Evaluation/EarlyStoppingMeanSquaredErrorEvaluator.cs

    r130 r137  
    3434    public override string Description {
    3535      get {
    36         return @"Evaluates 'OperatorTree' for samples 'FirstSampleIndex' - 'LastSampleIndex' (inclusive) and calculates the mean-squared-error
     36        return @"Evaluates 'OperatorTree' 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.";
     
    4646
    4747    public override double Evaluate(IScope scope, IFunction function, int targetVariable, Dataset dataset) {
    48       double qualityLimit = GetVariableValue<DoubleData>("QualityLimit", scope, true).Data;
     48      double qualityLimit = GetVariableValue<DoubleData>("QualityLimit", scope, false).Data;
    4949      double errorsSquaredSum = 0;
    5050      double targetMean = dataset.GetMean(targetVariable);
     
    6262        errorsSquaredSum += error * error;
    6363
    64         // check the limit every 10 samples and stop as soon as we hit the limit
    65         if(sample % 10 == 9)
    66           if(qualityLimit < errorsSquaredSum / dataset.Rows ||
    67             double.IsNaN(errorsSquaredSum) ||
    68             double.IsInfinity(errorsSquaredSum))
    69             return errorsSquaredSum / sample; // return estimated MSE (when the remaining errors are on average the same)
     64        // check the limit and stop as soon as we hit the limit
     65        if(errorsSquaredSum / dataset.Rows >= qualityLimit)
     66          return errorsSquaredSum / (sample+1); // return estimated MSE (when the remaining errors are on average the same)
    7067      }
    7168      errorsSquaredSum /= dataset.Rows;
  • branches/3.0/sources/HeuristicLab.StructureIdentification/Evaluation/GPEvaluatorBase.cs

    r128 r137  
    5050
    5151      double result = Evaluate(scope, function, targetVariable, dataset);
    52       scope.AddVariable(new HeuristicLab.Core.Variable("Quality", new DoubleData(result)));
     52      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("Quality"), new DoubleData(result)));
    5353      return null;
    5454    }
Note: See TracChangeset for help on using the changeset viewer.