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.

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective
Files:
3 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  }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveMeanSquaredErrorEvaluator.cs

    r5809 r5851  
    2020#endregion
    2121
     22using System.Linq;
    2223using System.Collections.Generic;
    2324using HeuristicLab.Common;
     
    4647    public override IOperation Apply() {
    4748      IEnumerable<int> rows = GenerateRowsToEvaluate();
    48       double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows);
     49      var solution = SymbolicExpressionTreeParameter.ActualValue;
     50      double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows);
    4951      QualityParameter.ActualValue = new DoubleValue(quality);
     52      AddEvaluatedNodes(solution.Length * rows.Count());
    5053      return base.Apply();
    5154    }
     
    6164      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context;
    6265      EstimationLimitsParameter.ExecutionContext = context;
     66      EvaluatedNodesParameter.ExecutionContext = context;
    6367
    6468      double mse = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows);
     69      AddEvaluatedNodes(tree.Length * rows.Count());
    6570
    6671      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
    6772      EstimationLimitsParameter.ExecutionContext = null;
     73      EvaluatedNodesParameter.ExecutionContext = null;
    6874
    6975      return mse;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectivePearsonRSquaredEvaluator.cs

    r5846 r5851  
    2121
    2222using System;
     23using System.Linq;
    2324using System.Collections.Generic;
    2425using HeuristicLab.Common;
     
    4748    public override IOperation Apply() {
    4849      IEnumerable<int> rows = GenerateRowsToEvaluate();
    49       double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows);
     50      var solution = SymbolicExpressionTreeParameter.ActualValue;
     51      double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows);
    5052      QualityParameter.ActualValue = new DoubleValue(quality);
     53      AddEvaluatedNodes(solution.Length * rows.Count());
    5154      return base.Apply();
    5255    }
     
    6265      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context;
    6366      EstimationLimitsParameter.ExecutionContext = context;
     67      EvaluatedNodesParameter.ExecutionContext = context;
    6468
    6569      double r2 = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows);
     70      AddEvaluatedNodes(tree.Length * rows.Count());
    6671
    6772      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
    6873      EstimationLimitsParameter.ExecutionContext = null;
     74      EvaluatedNodesParameter.ExecutionContext = null;
    6975
    7076      return r2;
Note: See TracChangeset for help on using the changeset viewer.