Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/01/15 00:12:46 (8 years ago)
Author:
bburlacu
Message:

#2480: Reverted changes to the evaluators as they impact performance and memory usage.

File:
1 edited

Legend:

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

    r12973 r12977  
    5050      IEnumerable<int> rows = GenerateRowsToEvaluate();
    5151
    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);
    6853      QualityParameter.ActualValue = new DoubleValue(quality);
    6954
     
    7459      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    7560      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) {
    8061      IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
    8162
Note: See TracChangeset for help on using the changeset viewer.