Changeset 12977 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionMeanRelativeErrorEvaluator.cs
- Timestamp:
- 10/01/15 00:12:46 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionMeanRelativeErrorEvaluator.cs
r12973 r12977 50 50 IEnumerable<int> rows = GenerateRowsToEvaluate(); 51 51 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); 52 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows); 68 53 QualityParameter.ActualValue = new DoubleValue(quality); 69 54 … … 74 59 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 75 60 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) {80 61 IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit); 81 62
Note: See TracChangeset
for help on using the changeset viewer.