Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/14/09 13:46:57 (15 years ago)
Author:
gkronber
Message:

Refactored GP evaluation to make it possible to use different evaluators to interpret function trees. #615 (Evaluation of HL3 function trees should be equivalent to evaluation in HL2)

File:
1 edited

Legend:

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

    r712 r1796  
    5353    }
    5454
    55     public override void Evaluate(IScope scope, BakedTreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
     55    public override void Evaluate(IScope scope, ITreeEvaluator evaluator, IFunctionTree tree, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
    5656      int nSamples = end - start;
    5757      double[] errors = new double[nSamples];
    5858      double[] originalTargetVariableValues = new double[nSamples];
    5959      for (int sample = start; sample < end; sample++) {
    60         double estimated = evaluator.Evaluate(sample);
     60        double estimated = evaluator.Evaluate(tree, sample);
    6161        double original = dataset.GetValue(sample, targetVariable);
    6262        if (updateTargetValues) {
     
    6666          errors[sample - start] = original - estimated;
    6767          originalTargetVariableValues[sample - start] = original;
     68        } else {
     69          errors[sample - start] = double.NaN;
     70          originalTargetVariableValues[sample - start] = double.NaN;
    6871        }
    6972      }
Note: See TracChangeset for help on using the changeset viewer.