Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/18/11 10:01:00 (13 years ago)
Author:
gkronber
Message:

#1418 renamed bounded evaluator, added base classes for single objective and multi objective validation analzers, added overfitting analyzers for symbolic regression and classification.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectivePearsonRSquaredEvaluator.cs

    r5722 r5747  
    2626using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using System;
    2829
    2930namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
     
    5455      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    5556      IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
    56       return OnlinePearsonsRSquaredEvaluator.Calculate(originalValues, estimatedValues);
     57      try {
     58        return OnlinePearsonsRSquaredEvaluator.Calculate(originalValues, estimatedValues);
     59      }
     60      catch (ArgumentException) {
     61        // if R² cannot be calculated because of NaN or ininity elements => return worst possible fitness valuse
     62        return 0.0;
     63      }
    5764    }
    5865
Note: See TracChangeset for help on using the changeset viewer.