Changeset 10432
- Timestamp:
- 01/31/14 17:20:17 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionMeanRelativeErrorEvaluator.cs
r10355 r10432 30 30 31 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression { 32 [Item("Mean relative error Evaluator", "Evaluator for symbolic regression models that calculates the mean relative error avg( |y'-y| / |y|+1)." +32 [Item("Mean relative error Evaluator", "Evaluator for symbolic regression models that calculates the mean relative error avg( |y' - y| / (|y| + 1))." + 33 33 "The +1 is necessary to handle data with the value of 0.0 correctly. " + 34 34 "Notice: Linear scaling is ignored for this evaluator.")] … … 50 50 IEnumerable<int> rows = GenerateRowsToEvaluate(); 51 51 52 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows , ApplyLinearScalingParameter.ActualValue.Value);52 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows); 53 53 QualityParameter.ActualValue = new DoubleValue(quality); 54 54 … … 56 56 } 57 57 58 public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows , bool applyLinearScaling) {58 public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) { 59 59 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 60 60 IEnumerable<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); … … 75 75 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context; 76 76 EstimationLimitsParameter.ExecutionContext = context; 77 ApplyLinearScalingParameter.ExecutionContext = context;78 77 79 double mre = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows , ApplyLinearScalingParameter.ActualValue.Value);78 double mre = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows); 80 79 81 80 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; 82 81 EstimationLimitsParameter.ExecutionContext = null; 83 ApplyLinearScalingParameter.ExecutionContext = null;84 82 85 83 return mre;
Note: See TracChangeset
for help on using the changeset viewer.