Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/08/14 19:29:00 (10 years ago)
Author:
mkommend
Message:

#2143: Merged r10368, r10375, r10378, r10414, r10417, r10418, r10428, r10469, r10470, r11013, r11025, r11026, r11027 into stable.

Location:
stable
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationPruningAnalyzer.cs

    r10368 r11145  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
    222using HeuristicLab.Common;
    323using HeuristicLab.Core;
    4 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    524using HeuristicLab.Parameters;
    625using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    1029  [StorableClass]
    1130  public sealed class SymbolicClassificationPruningAnalyzer : SymbolicDataAnalysisSingleObjectivePruningAnalyzer {
    12     private const string ModelCreatorParameterName = "ModelCreator";
    13     #region parameter properties
    14     public ILookupParameter<ISymbolicClassificationModelCreator> ModelCreatorParameter {
    15       get { return (ILookupParameter<ISymbolicClassificationModelCreator>)Parameters[ModelCreatorParameterName]; }
    16     }
    17     #endregion
    18     #region properties
    19     private ISymbolicClassificationModelCreator ModelCreator {
    20       get { return ModelCreatorParameter.ActualValue; }
    21       set { ModelCreatorParameter.ActualValue = value; }
    22     }
    23     #endregion
    24 
    25     protected SymbolicClassificationPruningAnalyzer(SymbolicClassificationPruningAnalyzer original, Cloner cloner)
     31    private const string ImpactValuesCalculatorParameterName = "ImpactValuesCalculator";
     32    private const string PruningOperatorParameterName = "PruningOperator";
     33    private SymbolicClassificationPruningAnalyzer(SymbolicClassificationPruningAnalyzer original, Cloner cloner)
    2634      : base(original, cloner) {
    2735    }
     
    3038    }
    3139
     40    [StorableConstructor]
     41    private SymbolicClassificationPruningAnalyzer(bool deserializing) : base(deserializing) { }
     42
    3243    public SymbolicClassificationPruningAnalyzer() {
    33       // pruning parameters
    34       Parameters.Add(new LookupParameter<ISymbolicClassificationModelCreator>(ModelCreatorParameterName));
    35       impactValuesCalculator = new SymbolicClassificationSolutionImpactValuesCalculator();
    36     }
    37 
    38     protected override ISymbolicDataAnalysisModel CreateModel(ISymbolicExpressionTree tree,
    39       ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double lowerEstimationLimit = Double.MinValue,
    40       double upperEstimationLimit = Double.MaxValue) {
    41       var model = ModelCreator.CreateSymbolicClassificationModel(tree, Interpreter, lowerEstimationLimit, upperEstimationLimit);
    42       model.RecalculateModelParameters((IClassificationProblemData)ProblemData, ProblemData.TrainingIndices);
    43       return model;
     44      Parameters.Add(new ValueParameter<SymbolicDataAnalysisSolutionImpactValuesCalculator>(ImpactValuesCalculatorParameterName, "The impact values calculator", new SymbolicClassificationSolutionImpactValuesCalculator()));
     45      Parameters.Add(new ValueParameter<SymbolicDataAnalysisExpressionPruningOperator>(PruningOperatorParameterName, "The operator used to prune trees", new SymbolicClassificationPruningOperator()));
    4446    }
    4547  }
Note: See TracChangeset for help on using the changeset viewer.