Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10432


Ignore:
Timestamp:
01/31/14 17:20:17 (11 years ago)
Author:
mkommend
Message:

#2134: Implemented review comments for the mean relative error evaluator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionMeanRelativeErrorEvaluator.cs

    r10355 r10432  
    3030
    3131namespace 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))." +
    3333                                         "The +1 is necessary to handle data with the value of 0.0 correctly. " +
    3434                                         "Notice: Linear scaling is ignored for this evaluator.")]
     
    5050      IEnumerable<int> rows = GenerateRowsToEvaluate();
    5151
    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);
    5353      QualityParameter.ActualValue = new DoubleValue(quality);
    5454
     
    5656    }
    5757
    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) {
    5959      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    6060      IEnumerable<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
     
    7575      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context;
    7676      EstimationLimitsParameter.ExecutionContext = context;
    77       ApplyLinearScalingParameter.ExecutionContext = context;
    7877
    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);
    8079
    8180      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
    8281      EstimationLimitsParameter.ExecutionContext = null;
    83       ApplyLinearScalingParameter.ExecutionContext = null;
    8482
    8583      return mre;
Note: See TracChangeset for help on using the changeset viewer.