Changeset 18220 for trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionMeanRelativeErrorEvaluator.cs
- Timestamp:
- 02/24/22 20:33:45 (11 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionMeanRelativeErrorEvaluator.cs
r17180 r18220 47 47 48 48 public override IOperation InstrumentedApply() { 49 var solution= SymbolicExpressionTreeParameter.ActualValue;49 var tree = SymbolicExpressionTreeParameter.ActualValue; 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 double quality = Calculate( 53 tree, ProblemDataParameter.ActualValue, rows, 54 SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, 55 EstimationLimitsParameter.ActualValue.Lower, 56 EstimationLimitsParameter.ActualValue.Upper); 53 57 QualityParameter.ActualValue = new DoubleValue(quality); 54 58 … … 56 60 } 57 61 58 public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) { 59 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 62 public static double Calculate( 63 ISymbolicExpressionTree tree, 64 IRegressionProblemData problemData, 65 IEnumerable<int> rows, 66 ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, 67 double lowerEstimationLimit, double upperEstimationLimit) { 68 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, rows); 60 69 IEnumerable<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); 61 70 IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit); … … 76 85 EstimationLimitsParameter.ExecutionContext = context; 77 86 78 double mre = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows); 87 double mre = Calculate( 88 tree, problemData, rows, 89 SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, 90 EstimationLimitsParameter.ActualValue.Lower, 91 EstimationLimitsParameter.ActualValue.Upper); 79 92 80 93 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; … … 83 96 return mre; 84 97 } 98 99 public override double Evaluate( 100 ISymbolicExpressionTree tree, 101 IRegressionProblemData problemData, 102 IEnumerable<int> rows, 103 ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, 104 bool applyLinearScaling = true, 105 double lowerEstimationLimit = double.MinValue, 106 double upperEstimationLimit = double.MaxValue) { 107 return Calculate(tree, problemData, rows, interpreter, lowerEstimationLimit, upperEstimationLimit); 108 } 85 109 } 86 110 }
Note: See TracChangeset
for help on using the changeset viewer.