Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/01/15 00:12:46 (9 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/SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator.cs

    r12973 r12977  
    2121
    2222using System.Collections.Generic;
    23 using System.Linq;
    2423using HeuristicLab.Common;
    2524using HeuristicLab.Core;
     
    4746      IEnumerable<int> rows = GenerateRowsToEvaluate();
    4847
    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);
    6549      QualityParameter.ActualValue = new DoubleValue(quality);
    6650
     
    7155      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    7256      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) {
    7757      OnlineCalculatorError errorState;
    7858
Note: See TracChangeset for help on using the changeset viewer.