- Timestamp:
- 03/28/11 17:27:00 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs
r5809 r5846 55 55 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 56 56 IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows); 57 try { 58 double r2 = OnlinePearsonsRSquaredEvaluator.Calculate(originalValues, estimatedValues); 59 return new double[2] { r2, solution.Length }; 60 } 61 catch (ArgumentException) { 62 // if R² cannot be calcualted return worst possible fitness value 63 return new double[2] { 0.0, solution.Length }; 64 } 57 double r2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedValues, originalValues); 58 return new double[] { double.IsNaN(r2) ? 0.0 : r2, solution.Length }; 65 59 } 66 60 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.cs
r5823 r5846 55 55 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 56 56 IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows); 57 try { 58 return OnlinePearsonsRSquaredEvaluator.Calculate(estimatedValues, originalValues); 59 } 60 catch (ArgumentException) { 61 // if R² cannot be calculated because of NaN or ininity elements => return worst possible fitness value 62 return 0.0; 63 } 57 double r2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedValues, originalValues); 58 return double.IsNaN(r2) ? 0.0 : r2; 64 59 } 65 60
Note: See TracChangeset
for help on using the changeset viewer.