Ignore:
Timestamp:
01/28/14 19:18:25 (9 years ago)
Author:
bburlacu
Message:

#2143: Modified the pruning operator and analyzer to use the FitnessCalculationPartition for impact and replacement values calculation, instead of the whole training data partition.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionPruningOperator.cs

    r10378 r10414  
    4949    private DoubleValue PrunedTrees { get { return NumberOfPrunedTreesParameter.ActualValue; } }
    5050    #endregion
    51 
    52     [StorableConstructor]
    53     protected SymbolicDataAnalysisExpressionPruningOperator(bool deserializing) : base(deserializing) { }
    5451    public override IDeepCloneable Clone(Cloner cloner) {
    5552      return new SymbolicDataAnalysisExpressionPruningOperator(this, cloner);
    5653    }
    57     protected SymbolicDataAnalysisExpressionPruningOperator(SymbolicDataAnalysisExpressionPruningOperator original, Cloner cloner)
     54    private SymbolicDataAnalysisExpressionPruningOperator(SymbolicDataAnalysisExpressionPruningOperator original, Cloner cloner)
    5855      : base(original, cloner) {
    5956    }
     
    6764    public IDataAnalysisProblemData ProblemData { get; set; }
    6865    public ISymbolicDataAnalysisSolutionImpactValuesCalculator ImpactsCalculator { get; set; }
     66
     67    public IntRange FitnessCalculationPartition { get; set; }
    6968    public IRandom Random { get; set; }
    7069
     
    7675
    7776      var nodes = Model.SymbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList();
     77      var rows = Enumerable.Range(FitnessCalculationPartition.Start, FitnessCalculationPartition.Size).ToList();
    7878
    7979      for (int j = 0; j < nodes.Count; ++j) {
     
    8181        if (node is ConstantTreeNode) continue;
    8282
    83         var impact = ImpactsCalculator.CalculateImpactValue(Model, node, ProblemData, ProblemData.TrainingIndices);
     83        var impact = ImpactsCalculator.CalculateImpactValue(Model, node, ProblemData, rows);
    8484
    8585        if (PruneOnlyZeroImpactNodes) {
     
    8989        }
    9090
    91         var replacementValue = ImpactsCalculator.CalculateReplacementValue(Model, node, ProblemData, ProblemData.TrainingIndices);
     91        var replacementValue = ImpactsCalculator.CalculateReplacementValue(Model, node, ProblemData, rows);
    9292        var constantNode = new ConstantTreeNode(new Constant()) { Value = replacementValue };
    9393        ReplaceWithConstant(node, constantNode);
Note: See TracChangeset for help on using the changeset viewer.