Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/30/11 18:04:03 (14 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.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs

    r5818 r5894  
    7878        .ToArray();
    7979      var targetValues = dataset.GetEnumeratedVariableValues(targetVariable, rows);
    80 
    81       double originalR2 = OnlinePearsonsRSquaredEvaluator.Calculate(targetValues, originalOutput);
     80      OnlineEvaluatorError errorState;
     81      double originalR2 = OnlinePearsonsRSquaredEvaluator.Calculate(targetValues, originalOutput, out errorState);
     82      if (errorState != OnlineEvaluatorError.None) originalR2 = 0.0;
    8283
    8384      foreach (ISymbolicExpressionTreeNode node in nodes) {
     
    8788        SwitchNode(parent, node, replacementNode);
    8889        var newOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows);
    89         double newR2 = OnlinePearsonsRSquaredEvaluator.Calculate(targetValues, newOutput);
     90        double newR2 = OnlinePearsonsRSquaredEvaluator.Calculate(targetValues, newOutput, out errorState);
     91        if (errorState != OnlineEvaluatorError.None) newR2 = 0.0;
    9092
    9193        // impact = 0 if no change
Note: See TracChangeset for help on using the changeset viewer.