Changeset 5846 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective
- Timestamp:
- 03/28/11 17:27:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs
r5809 r5846 34 34 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 35 35 IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows); 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 } 36 double r2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedValues, originalValues); 37 return new double[] { double.IsNaN(r2) ? 0.0 : r2, solution.Length }; 44 38 } 45 39
Note: See TracChangeset
for help on using the changeset viewer.