Changeset 8635


Ignore:
Timestamp:
09/12/12 12:24:52 (10 years ago)
Author:
mkommend
Message:

#1951: Corrected handling of invalid values in the symbolic regression evaluators.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveEvaluator.cs

    r8127 r8635  
    7474      var targetValuesEnumerator = targetValues.GetEnumerator();
    7575      var estimatedValuesEnumerator = estimatedValues.GetEnumerator();
    76       while (targetValuesEnumerator.MoveNext() && estimatedValuesEnumerator.MoveNext()) {
     76      while (targetValuesEnumerator.MoveNext() & estimatedValuesEnumerator.MoveNext()) {
    7777        double target = targetValuesEnumerator.Current;
    7878        double estimated = estimatedValuesEnumerator.Current;
     
    8181        i++;
    8282      }
     83      if (linearScalingCalculator.ErrorState == OnlineCalculatorError.None && (targetValuesEnumerator.MoveNext() || estimatedValuesEnumerator.MoveNext()))
     84        throw new ArgumentException("Number of elements in target and estimated values enumeration do not match.");
     85
    8386      double alpha = linearScalingCalculator.Alpha;
    8487      double beta = linearScalingCalculator.Beta;
     88      if (linearScalingCalculator.ErrorState != OnlineCalculatorError.None) {
     89        alpha = 0.0;
     90        beta = 1.0;
     91      }
    8592
    8693      //calculate the quality by using the passed online calculator
Note: See TracChangeset for help on using the changeset viewer.