Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12720


Ignore:
Timestamp:
07/10/15 15:41:09 (9 years ago)
Author:
bburlacu
Message:

#2359: Changed the impact calculators so that the quality value necessary for impacts calculation is calculated with a separate method. Refactored the CalculateImpactAndReplacementValues method to return the new quality in an out-parameter (adjusted method signature in interface accordingly). Added Evaluate method to the regression and classification pruning operators that re-evaluates the tree using the problem evaluator after pruning was performed.

Location:
trunk/sources
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicClassificationSolutionSimplifierViewBase.cs

    r12012 r12720  
    7474      var impactAndReplacementValues = new Dictionary<ISymbolicExpressionTreeNode, Tuple<double, double>>();
    7575      foreach (var node in tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix()) {
    76         double impactValue, replacementValue;
    77         calculator.CalculateImpactAndReplacementValues(Content.Model, node, Content.ProblemData, Content.ProblemData.TrainingIndices, out impactValue, out replacementValue);
     76        double impactValue, replacementValue, newQualityForImpactsCalculation;
     77        calculator.CalculateImpactAndReplacementValues(Content.Model, node, Content.ProblemData, Content.ProblemData.TrainingIndices, out impactValue, out replacementValue, out newQualityForImpactsCalculation);
    7878        impactAndReplacementValues.Add(node, new Tuple<double, double>(impactValue, replacementValue));
    7979      }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationPruningAnalyzer.cs

    r12358 r12720  
    4545
    4646    public SymbolicClassificationPruningAnalyzer() {
    47       Parameters.Add(new ValueParameter<SymbolicDataAnalysisExpressionPruningOperator>(PruningOperatorParameterName, "The operator used to prune trees", new SymbolicClassificationPruningOperator(new SymbolicClassificationSolutionImpactValuesCalculator())));
     47      Parameters.Add(new ValueParameter<SymbolicClassificationPruningOperator>(PruningOperatorParameterName, "The operator used to prune trees", new SymbolicClassificationPruningOperator(new SymbolicClassificationSolutionImpactValuesCalculator())));
    4848    }
    4949  }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationPruningOperator.cs

    r12461 r12720  
    3535  public class SymbolicClassificationPruningOperator : SymbolicDataAnalysisExpressionPruningOperator {
    3636    private const string ModelCreatorParameterName = "ModelCreator";
     37    private const string EvaluatorParameterName = "Evaluator";
    3738
    3839    #region parameter properties
    3940    public ILookupParameter<ISymbolicClassificationModelCreator> ModelCreatorParameter {
    4041      get { return (ILookupParameter<ISymbolicClassificationModelCreator>)Parameters[ModelCreatorParameterName]; }
     42    }
     43
     44    public ILookupParameter<ISymbolicClassificationSingleObjectiveEvaluator> EvaluatorParameter {
     45      get {
     46        return (ILookupParameter<ISymbolicClassificationSingleObjectiveEvaluator>)Parameters[EvaluatorParameterName];
     47      }
    4148    }
    4249    #endregion
     
    5158      : base(impactValuesCalculator) {
    5259      Parameters.Add(new LookupParameter<ISymbolicClassificationModelCreator>(ModelCreatorParameterName));
     60      Parameters.Add(new LookupParameter<ISymbolicClassificationSingleObjectiveEvaluator>(EvaluatorParameterName));
    5361    }
    5462
     
    6270
    6371    protected override double Evaluate(IDataAnalysisModel model) {
    64       var classificationModel = (IClassificationModel)model;
     72      var evaluator = EvaluatorParameter.ActualValue;
     73      var classificationModel = (ISymbolicClassificationModel)model;
    6574      var classificationProblemData = (IClassificationProblemData)ProblemDataParameter.ActualValue;
    6675      var rows = Enumerable.Range(FitnessCalculationPartitionParameter.ActualValue.Start, FitnessCalculationPartitionParameter.ActualValue.Size);
    67 
    68       return Evaluate(classificationModel, classificationProblemData, rows);
    69     }
    70 
    71     private static double Evaluate(IClassificationModel model, IClassificationProblemData problemData, IEnumerable<int> rows) {
    72       var estimatedValues = model.GetEstimatedClassValues(problemData.Dataset, rows);
    73       var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
    74       OnlineCalculatorError errorState;
    75       var quality = OnlineAccuracyCalculator.Calculate(targetValues, estimatedValues, out errorState);
    76       if (errorState != OnlineCalculatorError.None) return double.NaN;
    77       return quality;
     76      return evaluator.Evaluate(this.ExecutionContext, classificationModel.SymbolicExpressionTree, classificationProblemData, rows);
    7877    }
    7978
     
    8685
    8786      var nodes = clonedTree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList();
    88       double quality = Evaluate(model, problemData, rows);
     87      double qualityForImpactsCalculation = double.NaN;
    8988
    9089      for (int i = 0; i < nodes.Count; ++i) {
     
    9291        if (node is ConstantTreeNode) continue;
    9392
    94         double impactValue, replacementValue;
    95         impactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, quality);
     93        double impactValue, replacementValue, newQualityForImpactsCalculation;
     94        impactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, out newQualityForImpactsCalculation, qualityForImpactsCalculation);
    9695
    9796        if (pruneOnlyZeroImpactNodes && !impactValue.IsAlmost(0.0)) continue;
     
    104103        i += node.GetLength() - 1; // skip subtrees under the node that was folded
    105104
    106         quality -= impactValue;
     105        qualityForImpactsCalculation = newQualityForImpactsCalculation;
    107106      }
    108107      return model.SymbolicExpressionTree;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationSolutionImpactValuesCalculator.cs

    r12012 r12720  
    4747    }
    4848
    49     public override double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double originalQuality = double.NaN) {
     49    public override double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double qualityForImpactsCalculation = double.NaN) {
    5050      double impactValue, replacementValue;
    51       CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, originalQuality);
     51      double newQualityForImpactsCalculation;
     52      CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, out newQualityForImpactsCalculation, qualityForImpactsCalculation);
    5253      return impactValue;
    5354    }
    5455
    5556    public override void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node,
    56       IDataAnalysisProblemData problemData, IEnumerable<int> rows, out double impactValue, out double replacementValue,
    57       double originalQuality = Double.NaN) {
     57      IDataAnalysisProblemData problemData, IEnumerable<int> rows, out double impactValue, out double replacementValue, out double newQualityForImpactsCalculation,
     58      double qualityForImpactsCalculation = Double.NaN) {
    5859      var classificationModel = (ISymbolicClassificationModel)model;
    5960      var classificationProblemData = (IClassificationProblemData)problemData;
    6061
    61       var dataset = classificationProblemData.Dataset;
    62       var targetClassValues = dataset.GetDoubleValues(classificationProblemData.TargetVariable, rows);
    63 
    64       OnlineCalculatorError errorState;
    65       if (double.IsNaN(originalQuality)) {
    66         var originalClassValues = classificationModel.GetEstimatedClassValues(dataset, rows);
    67         originalQuality = OnlineAccuracyCalculator.Calculate(targetClassValues, originalClassValues, out errorState);
    68         if (errorState != OnlineCalculatorError.None) originalQuality = 0.0;
    69       }
     62      if (double.IsNaN(qualityForImpactsCalculation))
     63        qualityForImpactsCalculation = CalculateQualityForImpacts(classificationModel, classificationProblemData, rows);
    7064
    7165      replacementValue = CalculateReplacementValue(classificationModel, node, classificationProblemData, rows);
     
    8175      tempModelParentNode.InsertSubtree(i, constantNode);
    8276
     77      OnlineCalculatorError errorState;
     78      var dataset = classificationProblemData.Dataset;
     79      var targetClassValues = dataset.GetDoubleValues(classificationProblemData.TargetVariable, rows);
    8380      var estimatedClassValues = tempModel.GetEstimatedClassValues(dataset, rows);
    84       double newQuality = OnlineAccuracyCalculator.Calculate(targetClassValues, estimatedClassValues, out errorState);
    85       if (errorState != OnlineCalculatorError.None) newQuality = 0.0;
     81      newQualityForImpactsCalculation = OnlineAccuracyCalculator.Calculate(targetClassValues, estimatedClassValues, out errorState);
     82      if (errorState != OnlineCalculatorError.None) newQualityForImpactsCalculation = 0.0;
    8683
    87       impactValue = originalQuality - newQuality;
     84      impactValue = qualityForImpactsCalculation - newQualityForImpactsCalculation;
     85    }
     86
     87    public static double CalculateQualityForImpacts(ISymbolicClassificationModel model, IClassificationProblemData problemData, IEnumerable<int> rows) {
     88      OnlineCalculatorError errorState;
     89      var dataset = problemData.Dataset;
     90      var targetClassValues = dataset.GetDoubleValues(problemData.TargetVariable, rows);
     91      var originalClassValues = model.GetEstimatedClassValues(dataset, rows);
     92      var qualityForImpactsCalculation = OnlineAccuracyCalculator.Calculate(targetClassValues, originalClassValues, out errorState);
     93      if (errorState != OnlineCalculatorError.None) qualityForImpactsCalculation = 0.0;
     94
     95      return qualityForImpactsCalculation;
    8896    }
    8997  }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs

    r12012 r12720  
    6363      var impactAndReplacementValues = new Dictionary<ISymbolicExpressionTreeNode, Tuple<double, double>>();
    6464      foreach (var node in tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix()) {
    65         double impactValue, replacementValue;
    66         calculator.CalculateImpactAndReplacementValues(Content.Model, node, Content.ProblemData, Content.ProblemData.TrainingIndices, out impactValue, out replacementValue);
     65        double impactValue, replacementValue, newQualityForImpactsCalculation;
     66        calculator.CalculateImpactAndReplacementValues(Content.Model, node, Content.ProblemData, Content.ProblemData.TrainingIndices, out impactValue, out replacementValue, out newQualityForImpactsCalculation);
    6767        impactAndReplacementValues.Add(node, new Tuple<double, double>(impactValue, replacementValue));
    6868      }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPruningOperator.cs

    r12641 r12720  
    2727using HeuristicLab.Core;
    2828using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     29using HeuristicLab.Parameters;
    2930using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3031
     
    3334  [Item("SymbolicRegressionPruningOperator", "An operator which prunes symbolic regression trees.")]
    3435  public class SymbolicRegressionPruningOperator : SymbolicDataAnalysisExpressionPruningOperator {
     36    private const string EvaluatorParameterName = "Evaluator";
     37
     38    #region parameter properties
     39    public ILookupParameter<ISymbolicRegressionSingleObjectiveEvaluator> EvaluatorParameter {
     40      get { return (ILookupParameter<ISymbolicRegressionSingleObjectiveEvaluator>)Parameters[EvaluatorParameterName]; }
     41    }
     42    #endregion
     43
    3544    protected SymbolicRegressionPruningOperator(SymbolicRegressionPruningOperator original, Cloner cloner)
    3645      : base(original, cloner) {
     
    4554    public SymbolicRegressionPruningOperator(ISymbolicDataAnalysisSolutionImpactValuesCalculator impactValuesCalculator)
    4655      : base(impactValuesCalculator) {
     56      Parameters.Add(new LookupParameter<ISymbolicRegressionSingleObjectiveEvaluator>(EvaluatorParameterName));
    4757    }
    4858
     
    5262
    5363    protected override double Evaluate(IDataAnalysisModel model) {
    54       var regressionModel = (IRegressionModel)model;
     64      var regressionModel = (ISymbolicRegressionModel)model;
    5565      var regressionProblemData = (IRegressionProblemData)ProblemDataParameter.ActualValue;
    56       var rows = Enumerable.Range(FitnessCalculationPartitionParameter.ActualValue.Start, FitnessCalculationPartitionParameter.ActualValue.Size);
    57       return Evaluate(regressionModel, regressionProblemData, rows);
    58     }
    59 
    60     private static double Evaluate(IRegressionModel model, IRegressionProblemData problemData,
    61       IEnumerable<int> rows) {
    62       var estimatedValues = model.GetEstimatedValues(problemData.Dataset, rows); // also bounds the values
    63       var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
    64       OnlineCalculatorError errorState;
    65       var quality = OnlinePearsonsRCalculator.Calculate(targetValues, estimatedValues, out errorState);
    66       if (errorState != OnlineCalculatorError.None) return double.NaN;
    67       return quality*quality;
     66      var evaluator = EvaluatorParameter.ActualValue;
     67      var fitnessEvaluationPartition = FitnessCalculationPartitionParameter.ActualValue;
     68      var rows = Enumerable.Range(fitnessEvaluationPartition.Start, fitnessEvaluationPartition.Size);
     69      return evaluator.Evaluate(this.ExecutionContext, regressionModel.SymbolicExpressionTree, regressionProblemData, rows);
    6870    }
    6971
     
    7274      var model = new SymbolicRegressionModel(clonedTree, interpreter, estimationLimits.Lower, estimationLimits.Upper);
    7375      var nodes = clonedTree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList(); // skip the nodes corresponding to the ProgramRootSymbol and the StartSymbol
    74       double quality = Evaluate(model, problemData, rows);
     76
     77      double qualityForImpactsCalculation = double.NaN; // pass a NaN value initially so the impact calculator will calculate the quality
    7578
    7679      for (int i = 0; i < nodes.Count; ++i) {
     
    7982
    8083        double impactValue, replacementValue;
    81         impactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, quality);
     84        double newQualityForImpactsCalculation;
     85        impactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, out newQualityForImpactsCalculation, qualityForImpactsCalculation);
    8286
    8387        if (pruneOnlyZeroImpactNodes && !impactValue.IsAlmost(0.0)) continue;
     
    9094        i += node.GetLength() - 1; // skip subtrees under the node that was folded
    9195
    92         quality -= impactValue;
     96        qualityForImpactsCalculation = newQualityForImpactsCalculation;
    9397      }
    9498      return model.SymbolicExpressionTree;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolutionImpactValuesCalculator.cs

    r12641 r12720  
    4848    }
    4949
    50     public override double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double originalQuality = double.NaN) {
    51       double impactValue, replacementValue;
    52       CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, originalQuality);
     50    public override double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double qualityForImpactsCalculation = double.NaN) {
     51      double impactValue, replacementValue, newQualityForImpactsCalculation;
     52      CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, out newQualityForImpactsCalculation, qualityForImpactsCalculation);
    5353      return impactValue;
    5454    }
    5555
    5656    public override void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node,
    57       IDataAnalysisProblemData problemData, IEnumerable<int> rows, out double impactValue, out double replacementValue,
    58       double originalQuality = Double.NaN) {
     57      IDataAnalysisProblemData problemData, IEnumerable<int> rows, out double impactValue, out double replacementValue, out double newQualityForImpactsCalculation,
     58      double qualityForImpactsCalculation = Double.NaN) {
    5959      var regressionModel = (ISymbolicRegressionModel)model;
    6060      var regressionProblemData = (IRegressionProblemData)problemData;
     
    6464
    6565      OnlineCalculatorError errorState;
    66       if (double.IsNaN(originalQuality)) {
    67         var originalValues = regressionModel.GetEstimatedValues(dataset, rows);
    68         originalQuality = OnlinePearsonsRCalculator.Calculate(targetValues, originalValues, out errorState);
    69         if (errorState != OnlineCalculatorError.None) originalQuality = 0.0;
    70       }
     66      if (double.IsNaN(qualityForImpactsCalculation))
     67        qualityForImpactsCalculation = CalculateQualityForImpacts(regressionModel, regressionProblemData, rows);
    7168
    7269      replacementValue = CalculateReplacementValue(regressionModel, node, regressionProblemData, rows);
     
    8380
    8481      var estimatedValues = tempModel.GetEstimatedValues(dataset, rows);
    85       double newQuality = OnlinePearsonsRCalculator.Calculate(targetValues, estimatedValues, out errorState);
    86       if (errorState != OnlineCalculatorError.None) newQuality = 0.0;
     82      double r = OnlinePearsonsRCalculator.Calculate(targetValues, estimatedValues, out errorState);
     83      if (errorState != OnlineCalculatorError.None) r = 0.0;
     84      newQualityForImpactsCalculation = r * r;
    8785
    88       impactValue = (originalQuality*originalQuality) - (newQuality*newQuality);
     86      impactValue = qualityForImpactsCalculation - newQualityForImpactsCalculation;
     87    }
     88
     89    public static double CalculateQualityForImpacts(ISymbolicRegressionModel model, IRegressionProblemData problemData, IEnumerable<int> rows) {
     90      var estimatedValues = model.GetEstimatedValues(problemData.Dataset, rows); // also bounds the values
     91      var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
     92      OnlineCalculatorError errorState;
     93      var r = OnlinePearsonsRCalculator.Calculate(targetValues, estimatedValues, out errorState);
     94      var quality = r * r;
     95      if (errorState != OnlineCalculatorError.None) return double.NaN;
     96      return quality;
    8997    }
    9098  }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisImpactValuesCalculator.cs

    r10469 r12720  
    66  public interface ISymbolicDataAnalysisSolutionImpactValuesCalculator : IItem {
    77    double CalculateReplacementValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows);
    8     double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double originalQuality = double.NaN);
     8    double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double qualityForImpactsCalculation = double.NaN);
    99    void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData,
    10       IEnumerable<int> rows, out double impactValue, out double replacementValue, double originalQuality = double.NaN);
     10      IEnumerable<int> rows, out double impactValue, out double replacementValue, out double newQualityForImpactsCalculation, double qualityForImpactsCalculation = double.NaN);
    1111  }
    1212}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionPruningOperator.cs

    r12361 r12720  
    4949    private const string EstimationLimitsParameterName = "EstimationLimits";
    5050    private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter";
     51    private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";
    5152    #endregion
    5253
     
    8889      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName]; }
    8990    }
     91    public ILookupParameter<BoolValue> ApplyLinearScalingParameter {
     92      get { return (ILookupParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
     93    }
    9094    #endregion
    9195
     
    124128      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName));
    125129      Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName));
     130      Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName));
    126131      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisSolutionImpactValuesCalculator>(ImpactValuesCalculatorParameterName, impactValuesCalculator));
    127132      #endregion
     
    141146      var model = CreateModel(tree, interpreter, problemData, estimationLimits);
    142147      var nodes = tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList();
    143       var rows = Enumerable.Range(fitnessCalculationPartition.Start, fitnessCalculationPartition.Size);
     148      var rows = Enumerable.Range(fitnessCalculationPartition.Start, fitnessCalculationPartition.Size).ToList();
    144149      var prunedSubtrees = 0;
    145150      var prunedTrees = 0;
    146151      var prunedNodes = 0;
    147152
    148       double quality = Evaluate(model);
     153      double qualityForImpactsCalculation = double.NaN;
    149154
    150155      for (int i = 0; i < nodes.Count; ++i) {
     
    153158
    154159        double impactValue, replacementValue;
    155         ImpactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, quality);
     160        double newQualityForImpacts;
     161        ImpactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, out newQualityForImpacts, qualityForImpactsCalculation);
    156162
    157163        if (PruneOnlyZeroImpactNodes && !impactValue.IsAlmost(0.0)) continue;
     
    165171        i += length - 1; // skip subtrees under the node that was folded
    166172
    167         quality -= impactValue;
    168173        prunedSubtrees++;
    169174        prunedNodes += length;
     175
     176        qualityForImpactsCalculation = newQualityForImpacts;
    170177      }
    171178
     
    174181      PrunedTreesParameter.ActualValue = new IntValue(prunedTrees);
    175182      PrunedNodesParameter.ActualValue = new IntValue(prunedNodes);
    176       QualityParameter.ActualValue.Value = quality;
     183
     184      if (prunedSubtrees > 0) // if nothing was pruned then there's no need to re-evaluate the tree
     185        QualityParameter.ActualValue.Value = Evaluate(model);
    177186
    178187      return base.Apply();
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs

    r12509 r12720  
    3737    protected SymbolicDataAnalysisSolutionImpactValuesCalculator(bool deserializing) : base(deserializing) { }
    3838    public abstract double CalculateReplacementValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows);
    39     public abstract double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double originalQuality = double.NaN);
    40     public abstract void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, out double impactValue, out double replacementValue, double originalQuality = double.NaN);
     39    public abstract double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double qualityForImpactsCalculation = double.NaN);
     40    public abstract void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, out double impactValue, out double replacementValue, out double newQualityForImpactsCalculation, double qualityForImpactsCalculation = double.NaN);
    4141
    4242    protected static double CalculateReplacementValue(ISymbolicExpressionTreeNode node, ISymbolicExpressionTree sourceTree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
Note: See TracChangeset for help on using the changeset viewer.