Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/04/15 13:08:49 (10 years ago)
Author:
gkronber
Message:

Merged revision(s) 12333-12365 from trunk/sources:
#2373: Corrected typo in RandomBinaryVectorCreator by implementing an after-deserialization-hook.

........
#2359: Refactored pruning operators and analyzers.

........
#2359: Removed commented code from pruning analyzer.

........
#2378: Vertex.cs: Fixed bug in Label setter.
........
#2359: The changes in r12358 look fine to me. Added total number of pruned nodes in the analyzer's data table. Removed unused parameter names in the SymbolicDataAnalysisSingleObjectivePruningAnalyzer.
........
#2345: Fixed x-axis maximum in error characteristics curve.

........

Location:
branches/GBT
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/GBT

  • branches/GBT/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification

  • branches/GBT/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationPruningAnalyzer.cs

    r12189 r12378  
    2929  [StorableClass]
    3030  public sealed class SymbolicClassificationPruningAnalyzer : SymbolicDataAnalysisSingleObjectivePruningAnalyzer {
    31     private const string ImpactValuesCalculatorParameterName = "ImpactValuesCalculator";
    3231    private const string PruningOperatorParameterName = "PruningOperator";
    33     private SymbolicClassificationPruningAnalyzer(SymbolicClassificationPruningAnalyzer original, Cloner cloner)
    34       : base(original, cloner) {
     32    public IValueParameter<SymbolicClassificationPruningOperator> PruningOperatorParameter {
     33      get { return (IValueParameter<SymbolicClassificationPruningOperator>)Parameters[PruningOperatorParameterName]; }
    3534    }
    36     public override IDeepCloneable Clone(Cloner cloner) {
    37       return new SymbolicClassificationPruningAnalyzer(this, cloner);
     35
     36    protected override SymbolicDataAnalysisExpressionPruningOperator PruningOperator {
     37      get { return PruningOperatorParameter.Value; }
    3838    }
     39
     40    private SymbolicClassificationPruningAnalyzer(SymbolicClassificationPruningAnalyzer original, Cloner cloner) : base(original, cloner) { }
     41    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicClassificationPruningAnalyzer(this, cloner); }
    3942
    4043    [StorableConstructor]
     
    4245
    4346    public SymbolicClassificationPruningAnalyzer() {
    44       Parameters.Add(new ValueParameter<SymbolicDataAnalysisSolutionImpactValuesCalculator>(ImpactValuesCalculatorParameterName, "The impact values calculator", new SymbolicClassificationSolutionImpactValuesCalculator()));
    4547      Parameters.Add(new ValueParameter<SymbolicDataAnalysisExpressionPruningOperator>(PruningOperatorParameterName, "The operator used to prune trees", new SymbolicClassificationPruningOperator(new SymbolicClassificationSolutionImpactValuesCalculator())));
    4648    }
  • branches/GBT/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationPruningOperator.cs

    r12189 r12378  
    4242    #endregion
    4343
    44     protected SymbolicClassificationPruningOperator(SymbolicClassificationPruningOperator original, Cloner cloner)
    45       : base(original, cloner) {
    46     }
    47 
    48     public override IDeepCloneable Clone(Cloner cloner) {
    49       return new SymbolicClassificationPruningOperator(this, cloner);
    50     }
     44    protected SymbolicClassificationPruningOperator(SymbolicClassificationPruningOperator original, Cloner cloner) : base(original, cloner) { }
     45    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicClassificationPruningOperator(this, cloner); }
    5146
    5247    [StorableConstructor]
     
    6863    protected override double Evaluate(IDataAnalysisModel model) {
    6964      var classificationModel = (IClassificationModel)model;
    70       var classificationProblemData = (IClassificationProblemData)ProblemData;
    71       var trainingIndices = Enumerable.Range(FitnessCalculationPartition.Start, FitnessCalculationPartition.Size);
     65      var classificationProblemData = (IClassificationProblemData)ProblemDataParameter.ActualValue;
     66      var rows = Enumerable.Range(FitnessCalculationPartitionParameter.ActualValue.Start, FitnessCalculationPartitionParameter.ActualValue.Size);
    7267
    73       return Evaluate(classificationModel, classificationProblemData, trainingIndices);
     68      return Evaluate(classificationModel, classificationProblemData, rows);
    7469    }
    7570
     
    10095        impactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, quality);
    10196
    102         if (pruneOnlyZeroImpactNodes) {
    103           if (!impactValue.IsAlmost(0.0)) continue;
    104         } else if (nodeImpactThreshold < impactValue) {
    105           continue;
    106         }
     97        if (pruneOnlyZeroImpactNodes && !impactValue.IsAlmost(0.0)) continue;
     98        if (!pruneOnlyZeroImpactNodes && impactValue > nodeImpactThreshold) continue;
    10799
    108100        var constantNode = (ConstantTreeNode)node.Grammar.GetSymbol("Constant").CreateTreeNode();
Note: See TracChangeset for help on using the changeset viewer.