Changeset 5685 for branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective
- Timestamp:
- 03/15/11 12:35:14 (14 years ago)
- Location:
- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs
r5623 r5685 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Parameters; 26 using HeuristicLab.Data; 25 27 26 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification { … … 30 32 public class SymbolicClassificationSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IClassificationProblemData, ISymbolicClassificationSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator> { 31 33 private const double PunishmentFactor = 10; 34 private const int InitialMaximumTreeDepth = 8; 35 private const int InitialMaximumTreeLength = 25; 36 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 37 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 38 private const string LowerEstimationLimitParameterDescription = "The lower limit for the estimated value that can be returned by the symbolic classification model."; 39 private const string UpperEstimationLimitParameterDescription = "The upper limit for the estimated value that can be returned by the symbolic classification model."; 32 40 41 #region parameter properties 42 public IFixedValueParameter<DoubleValue> LowerEstimationLimitParameter { 43 get { return (IFixedValueParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 44 } 45 public IFixedValueParameter<DoubleValue> UpperEstimationLimitParameter { 46 get { return (IFixedValueParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 47 } 48 #endregion 49 #region properties 50 public DoubleValue LowerEstimationLimit { 51 get { return LowerEstimationLimitParameter.Value; } 52 } 53 public DoubleValue UpperEstimationLimit { 54 get { return UpperEstimationLimitParameter.Value; } 55 } 56 #endregion 33 57 [StorableConstructor] 34 58 protected SymbolicClassificationSingleObjectiveProblem(bool deserializing) : base(deserializing) { } … … 38 62 public SymbolicClassificationSingleObjectiveProblem() 39 63 : base(new ClassificationProblemData(), new SymbolicClassificationSingleObjectiveMeanSquaredErrorEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { 40 MaximumSymbolicExpressionTreeDepth.Value = 8; 41 MaximumSymbolicExpressionTreeLength.Value = 25; 64 Parameters.Add(new FixedValueParameter<DoubleValue>(LowerEstimationLimitParameterName, LowerEstimationLimitParameterDescription, new DoubleValue())); 65 Parameters.Add(new FixedValueParameter<DoubleValue>(UpperEstimationLimitParameterName, UpperEstimationLimitParameterDescription, new DoubleValue())); 66 67 MaximumSymbolicExpressionTreeDepth.Value = InitialMaximumTreeDepth; 68 MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength; 69 70 InitializeOperators(); 42 71 } 43 72 44 protected override void UpdateEstimationLimits() { 73 private void InitializeOperators() { 74 Operators.Add(new SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer()); 75 Operators.Add(new SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer()); 76 ParameterizeOperators(); 77 } 78 79 private void UpdateEstimationLimits() { 45 80 if (ProblemData.TrainingPartitionStart.Value < ProblemData.TrainingPartitionEnd.Value) { 46 81 var targetValues = ProblemData.Dataset.GetVariableValues(ProblemData.TargetVariable, ProblemData.TrainingPartitionStart.Value, ProblemData.TrainingPartitionEnd.Value); … … 52 87 } 53 88 89 protected override void OnProblemDataChanged() { 90 base.OnProblemDataChanged(); 91 UpdateEstimationLimits(); 92 } 93 94 protected override void ParameterizeOperators() { 95 base.ParameterizeOperators(); 96 var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators); 97 foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedEvaluator<IClassificationProblemData>>()) { 98 op.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameterName; 99 op.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameterName; 100 } 101 } 102 54 103 public override void ImportProblemDataFromFile(string fileName) { 55 104 ClassificationProblemData problemData = ClassificationProblemData.ImportFromFile(fileName); -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer.cs
r5681 r5685 62 62 public SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer() 63 63 : base() { 64 Parameters.Add(new LookupParameter<IClassificationProblemData>(ProblemDataParameterName, "The problem data for the symbolic classification solution.")); 65 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree.")); 64 66 } 65 67 public override IDeepCloneable Clone(Cloner cloner) {
Note: See TracChangeset
for help on using the changeset viewer.