Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/07/08 16:59:35 (16 years ago)
Author:
gkronber
Message:

fixed small bugs in GP evaluators

File:
1 edited

Legend:

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

    r363 r367  
    4444
    4545    public override double Evaluate(IScope scope, IFunctionTree functionTree, int targetVariable, Dataset dataset) {
     46      int trainingStart = GetVariableValue<IntData>("TrainingSamplesStart", scope, true).Data;
     47      int trainingEnd = GetVariableValue<IntData>("TrainingSamplesEnd", scope, true).Data;
    4648      double errorsSquaredSum = 0.0;
    4749      double originalDeviationTotalSumOfSquares = 0.0;
    48       double targetMean = dataset.GetMean(targetVariable);
     50      double targetMean = dataset.GetMean(targetVariable, trainingStart, trainingEnd);
    4951      functionTree.PrepareEvaluation(dataset);
    50       for(int sample = 0; sample < dataset.Rows; sample++) {
     52      for(int sample = trainingStart; sample < trainingEnd; sample++) {
    5153        double estimated = functionTree.Evaluate(sample);
    5254        double original = dataset.GetValue(sample, targetVariable);
Note: See TracChangeset for help on using the changeset viewer.