Changeset 12977 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator.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/SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator.cs
r12973 r12977 21 21 22 22 using System.Collections.Generic; 23 using System.Linq;24 23 using HeuristicLab.Common; 25 24 using HeuristicLab.Core; … … 47 46 IEnumerable<int> rows = GenerateRowsToEvaluate(); 48 47 49 var problemData = ProblemDataParameter.ActualValue; 50 var interpreter = SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; 51 var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows).ToArray(); 52 var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); 53 var estimationLimits = EstimationLimitsParameter.ActualValue; 54 55 if (SaveEstimatedValuesToScope) { 56 var boundedValues = estimatedValues.LimitToRange(estimationLimits.Lower, estimationLimits.Upper).ToArray(); 57 var scope = ExecutionContext.Scope; 58 if (scope.Variables.ContainsKey("EstimatedValues")) 59 scope.Variables["EstimatedValues"].Value = new DoubleArray(boundedValues); 60 else 61 scope.Variables.Add(new Core.Variable("EstimatedValues", new DoubleArray(boundedValues))); 62 } 63 64 double quality = Calculate(targetValues, estimatedValues, estimationLimits.Lower, estimationLimits.Upper, problemData, ApplyLinearScalingParameter.ActualValue.Value); 48 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value); 65 49 QualityParameter.ActualValue = new DoubleValue(quality); 66 50 … … 71 55 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 72 56 IEnumerable<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); 73 return Calculate(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit, problemData, applyLinearScaling);74 }75 76 private static double Calculate(IEnumerable<double> targetValues, IEnumerable<double> estimatedValues, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, bool applyLinearScaling) {77 57 OnlineCalculatorError errorState; 78 58
Note: See TracChangeset
for help on using the changeset viewer.