Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/28/11 20:04:51 (14 years ago)
Author:
gkronber
Message:

#1411 added evaluated nodes parameter to symbolic data analysis evaluators.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveBoundedMeanSquaredErrorEvaluator.cs

    r5809 r5851  
    3333  [StorableClass]
    3434  public class SymbolicClassificationSingleObjectiveBoundedMeanSquaredErrorEvaluator : SymbolicClassificationSingleObjectiveEvaluator {
    35 
    3635    [StorableConstructor]
    3736    protected SymbolicClassificationSingleObjectiveBoundedMeanSquaredErrorEvaluator(bool deserializing) : base(deserializing) { }
     
    4746    public override IOperation Apply() {
    4847      IEnumerable<int> rows = GenerateRowsToEvaluate();
    49       double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows);
     48      var solution = SymbolicExpressionTreeParameter.ActualValue;
     49      double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows);
    5050      QualityParameter.ActualValue = new DoubleValue(quality);
     51      AddEvaluatedNodes(solution.Length * rows.Count());
    5152      return base.Apply();
    5253    }
     
    8889
    8990    public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IClassificationProblemData problemData, IEnumerable<int> rows) {
    90       return Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows);
     91      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context;
     92      EstimationLimitsParameter.ExecutionContext = context;
     93      EvaluatedNodesParameter.ExecutionContext = context;
     94
     95      double mse = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows);
     96      AddEvaluatedNodes(tree.Length * rows.Count());
     97
     98      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
     99      EstimationLimitsParameter.ExecutionContext = null;
     100      EvaluatedNodesParameter.ExecutionContext = null;
     101
     102      return mse;
    91103    }
    92104  }
Note: See TracChangeset for help on using the changeset viewer.