Changeset 5894 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective
- Timestamp:
- 03/30/11 18:04:03 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs
r5851 r5894 58 58 IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows); 59 59 IEnumerable<double> boundedEstimationValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit); 60 double mse = OnlineMeanSquaredErrorEvaluator.Calculate(originalValues, boundedEstimationValues); 60 OnlineEvaluatorError errorState; 61 double mse = OnlineMeanSquaredErrorEvaluator.Calculate(originalValues, boundedEstimationValues, out errorState); 62 if (errorState != OnlineEvaluatorError.None) mse = double.NaN; 61 63 return new double[2] { mse, solution.Length }; 62 64 } … … 72 74 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; 73 75 EstimationLimitsParameter.ExecutionContext = null; 74 EvaluatedNodesParameter.ExecutionContext = null; 76 EvaluatedNodesParameter.ExecutionContext = null; 75 77 76 78 return quality; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs
r5851 r5894 58 58 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 59 59 IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows); 60 double r2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedValues, originalValues); 61 return new double[] { double.IsNaN(r2) ? 0.0 : r2, solution.Length }; 60 OnlineEvaluatorError errorState; 61 double r2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedValues, originalValues, out errorState); 62 if (errorState != OnlineEvaluatorError.None) r2 = 0.0; 63 return new double[] { r2, solution.Length }; 62 64 } 63 65 … … 72 74 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; 73 75 EstimationLimitsParameter.ExecutionContext = null; 74 EvaluatedNodesParameter.ExecutionContext = null; 76 EvaluatedNodesParameter.ExecutionContext = null; 75 77 76 78 return quality;
Note: See TracChangeset
for help on using the changeset viewer.