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/MultiObjective/SymbolicClassificationMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs

    r5722 r5747  
    55using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    66using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     7using System;
    78
    89namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
     
    3334      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    3435      IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
    35       double r2 = OnlinePearsonsRSquaredEvaluator.Calculate(originalValues, estimatedValues);
    36       return new double[2] { r2, solution.Length };
     36      try {
     37        double r2 = OnlinePearsonsRSquaredEvaluator.Calculate(originalValues, estimatedValues);
     38        return new double[2] { r2, solution.Length };
     39      }
     40      catch (ArgumentException) {
     41        // if R² cannot be calcualted because of infinity or NaN values => return worst possible fitness value
     42        return new double[2] { 0.0, solution.Length };
     43      }
    3744    }
    3845
Note: See TracChangeset for help on using the changeset viewer.