Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/30/11 18:04:03 (13 years ago)
Author:
gkronber
Message:

#1453: Added an ErrorState property to online evaluators to indicate if the result value is valid or if there has been an error in the calculation. Adapted all classes that use one of the online evaluators to check this property.

File:
1 edited

Legend:

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

    r5851 r5894  
    6060      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    6161      IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
    62       double r2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedValues, originalValues);
    63       return double.IsNaN(r2) ? 0.0 : r2;
     62      OnlineEvaluatorError errorState;
     63      double r2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedValues, originalValues, out errorState);
     64      if (errorState != OnlineEvaluatorError.None) return 0.0;
     65      else return r2;
    6466    }
    6567
     
    7476      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
    7577      EstimationLimitsParameter.ExecutionContext = null;
    76       EvaluatedNodesParameter.ExecutionContext = null; 
     78      EvaluatedNodesParameter.ExecutionContext = null;
    7779
    7880      return r2;
Note: See TracChangeset for help on using the changeset viewer.