Changeset 10469 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationPruningAnalyzer.cs
- Timestamp:
- 02/19/14 14:04:03 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationPruningAnalyzer.cs
r10418 r10469 20 20 #endregion 21 21 22 using System;23 22 using HeuristicLab.Common; 24 23 using HeuristicLab.Core; 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;26 24 using HeuristicLab.Parameters; 27 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 31 29 [StorableClass] 32 30 public sealed class SymbolicClassificationPruningAnalyzer : SymbolicDataAnalysisSingleObjectivePruningAnalyzer { 33 private const string ModelCreatorParameterName = "ModelCreator"; 34 #region parameter properties 35 public ILookupParameter<ISymbolicClassificationModelCreator> ModelCreatorParameter { 36 get { return (ILookupParameter<ISymbolicClassificationModelCreator>)Parameters[ModelCreatorParameterName]; } 37 } 38 #endregion 39 #region properties 40 private ISymbolicClassificationModelCreator ModelCreator { 41 get { return ModelCreatorParameter.ActualValue; } 42 set { ModelCreatorParameter.ActualValue = value; } 43 } 44 #endregion 45 31 private const string ImpactValuesCalculatorParameterName = "ImpactValuesCalculator"; 32 private const string PruningOperatorParameterName = "PruningOperator"; 46 33 private SymbolicClassificationPruningAnalyzer(SymbolicClassificationPruningAnalyzer original, Cloner cloner) 47 34 : base(original, cloner) { … … 55 42 56 43 public SymbolicClassificationPruningAnalyzer() { 57 // pruning parameters 58 Parameters.Add(new LookupParameter<ISymbolicClassificationModelCreator>(ModelCreatorParameterName)); 59 impactValuesCalculator = new SymbolicClassificationSolutionImpactValuesCalculator(); 60 } 61 62 protected override ISymbolicDataAnalysisModel CreateModel(ISymbolicExpressionTree tree, 63 ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double lowerEstimationLimit = Double.MinValue, 64 double upperEstimationLimit = Double.MaxValue) { 65 var model = ModelCreator.CreateSymbolicClassificationModel(tree, Interpreter, lowerEstimationLimit, upperEstimationLimit); 66 model.RecalculateModelParameters((IClassificationProblemData)ProblemData, ProblemData.TrainingIndices); 67 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())); 68 46 } 69 47 }
Note: See TracChangeset
for help on using the changeset viewer.