- Timestamp:
- 03/30/11 18:04:03 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Files:
-
- 5 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; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator.cs
r5851 r5894 60 60 IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows); 61 61 IEnumerable<double> boundedEstimationValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit); 62 return OnlineMeanSquaredErrorEvaluator.Calculate(originalValues, boundedEstimationValues); 62 OnlineEvaluatorError errorState; 63 double mse = OnlineMeanSquaredErrorEvaluator.Calculate(originalValues, boundedEstimationValues, out errorState); 64 if (errorState != OnlineEvaluatorError.None) return double.NaN; 65 else return mse; 63 66 } 64 67 … … 74 77 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; 75 78 EstimationLimitsParameter.ExecutionContext = null; 76 EvaluatedNodesParameter.ExecutionContext = null; 79 EvaluatedNodesParameter.ExecutionContext = null; 77 80 78 81 return mse; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.cs
r5851 r5894 60 60 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 61 61 IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows); 62 double r2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedValues, originalValues); 63 return double.IsNaN(r2) ? 0.0 : r2; 62 OnlineEvaluatorError errorState; 63 double r2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedValues, originalValues, out errorState); 64 if (errorState != OnlineEvaluatorError.None) return 0.0; 65 else return r2; 64 66 } 65 67 … … 74 76 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; 75 77 EstimationLimitsParameter.ExecutionContext = null; 76 EvaluatedNodesParameter.ExecutionContext = null; 78 EvaluatedNodesParameter.ExecutionContext = null; 77 79 78 80 return r2; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs
r5818 r5894 75 75 double alpha; 76 76 double beta; 77 OnlineLinearScalingParameterCalculator.Calculate(estimatedValues, targetValues, out alpha, out beta); 77 OnlineEvaluatorError errorState; 78 OnlineLinearScalingParameterCalculator.Calculate(estimatedValues, targetValues, out alpha, out beta, out errorState); 79 if (errorState != OnlineEvaluatorError.None) return; 78 80 79 81 ConstantTreeNode alphaTreeNode = null;
Note: See TracChangeset
for help on using the changeset viewer.