Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/05/08 21:34:12 (16 years ago)
Author:
gkronber
Message:

fixed a stupid mistake introduced with r702 #328 (GP evaluation doesn't work in a thread parallel engine).

File:
1 edited

Legend:

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

    r702 r712  
    4545    public override void Evaluate(IScope scope, BakedTreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) {
    4646      double errorsSquaredSum = 0;
    47       for(int sample = start; sample < end; sample++) {
    48         double original = dataset.GetValue(targetVariable, sample);
     47      for (int sample = start; sample < end; sample++) {
     48        double original = dataset.GetValue(sample, targetVariable);
    4949        double estimated = evaluator.Evaluate(sample);
    50         if(updateTargetValues) {
    51           dataset.SetValue(targetVariable, sample, estimated);
     50        if (updateTargetValues) {
     51          dataset.SetValue(sample, targetVariable, estimated);
    5252        }
    53         if(!double.IsNaN(original) && !double.IsInfinity(original)) {
     53        if (!double.IsNaN(original) && !double.IsInfinity(original)) {
    5454          double error = estimated - original;
    5555          errorsSquaredSum += error * error;
     
    5858
    5959      errorsSquaredSum /= (end - start);
    60       if(double.IsNaN(errorsSquaredSum) || double.IsInfinity(errorsSquaredSum)) {
     60      if (double.IsNaN(errorsSquaredSum) || double.IsInfinity(errorsSquaredSum)) {
    6161        errorsSquaredSum = double.MaxValue;
    6262      }
    6363
    6464      DoubleData mse = GetVariableValue<DoubleData>("MSE", scope, false, false);
    65       if(mse == null) {
     65      if (mse == null) {
    6666        mse = new DoubleData();
    6767        scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("MSE"), mse));
Note: See TracChangeset for help on using the changeset viewer.