Changeset 12973 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionMeanRelativeErrorEvaluator.cs
- Timestamp:
- 09/29/15 16:49:13 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionMeanRelativeErrorEvaluator.cs
r12012 r12973 50 50 IEnumerable<int> rows = GenerateRowsToEvaluate(); 51 51 52 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows); 52 var problemData = ProblemDataParameter.ActualValue; 53 var interpreter = SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; 54 var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows).ToArray(); 55 var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); 56 var estimationLimits = EstimationLimitsParameter.ActualValue; 57 58 if (SaveEstimatedValuesToScope) { 59 var boundedValues = estimatedValues.LimitToRange(estimationLimits.Lower, estimationLimits.Upper).ToArray(); 60 var scope = ExecutionContext.Scope; 61 if (scope.Variables.ContainsKey("EstimatedValues")) 62 scope.Variables["EstimatedValues"].Value = new DoubleArray(boundedValues); 63 else 64 scope.Variables.Add(new Core.Variable("EstimatedValues", new DoubleArray(boundedValues))); 65 } 66 67 double quality = Calculate(targetValues, estimatedValues, estimationLimits.Lower, estimationLimits.Upper); 53 68 QualityParameter.ActualValue = new DoubleValue(quality); 54 69 … … 59 74 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 60 75 IEnumerable<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); 76 return Calculate(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit); 77 } 78 79 private static double Calculate(IEnumerable<double> targetValues, IEnumerable<double> estimatedValues, double lowerEstimationLimit, double upperEstimationLimit) { 61 80 IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit); 62 81
Note: See TracChangeset
for help on using the changeset viewer.