Changeset 11145 for stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationPruningAnalyzer.cs
- Timestamp:
- 07/08/14 19:29:00 (10 years ago)
- Location:
- stable
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 10368,10375,10378,10414,10417-10418,10428,10469-10470,11013,11025-11027
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification merged: 10368,10375,10378,10418,10469,11025-11026
- Property svn:mergeinfo changed
-
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 2 22 using HeuristicLab.Common; 3 23 using HeuristicLab.Core; 4 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;5 24 using HeuristicLab.Parameters; 6 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 10 29 [StorableClass] 11 30 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) 26 34 : base(original, cloner) { 27 35 } … … 30 38 } 31 39 40 [StorableConstructor] 41 private SymbolicClassificationPruningAnalyzer(bool deserializing) : base(deserializing) { } 42 32 43 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())); 44 46 } 45 47 }
Note: See TracChangeset
for help on using the changeset viewer.