Changeset 8206 for branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective
- Timestamp:
- 07/03/12 16:46:35 (12 years ago)
- Location:
- branches/GP-MoveOperators
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators
- Property svn:mergeinfo changed
/trunk/sources merged: 8084,8088-8090,8092-8100,8102-8113,8115,8117-8132,8134-8146,8148-8156,8158-8160,8163-8170,8173-8176,8178-8190,8192-8205
- Property svn:mergeinfo changed
-
branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs
r8085 r8206 48 48 [StorableConstructor] 49 49 protected SymbolicClassificationSingleObjectiveProblem(bool deserializing) : base(deserializing) { } 50 protected SymbolicClassificationSingleObjectiveProblem(SymbolicClassificationSingleObjectiveProblem original, Cloner cloner) : base(original, cloner) { } 50 protected SymbolicClassificationSingleObjectiveProblem(SymbolicClassificationSingleObjectiveProblem original, Cloner cloner) 51 : base(original, cloner) { 52 RegisterEventHandlers(); 53 } 51 54 public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicClassificationSingleObjectiveProblem(this, cloner); } 52 55 … … 60 63 MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength; 61 64 62 SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols(); 63 65 RegisterEventHandlers(); 64 66 ConfigureGrammarSymbols(); 65 67 InitializeOperators(); 66 68 UpdateEstimationLimits(); 69 } 70 71 [StorableHook(HookType.AfterDeserialization)] 72 private void AfterDeserialization() { 73 RegisterEventHandlers(); 74 // compatibility 75 bool changed = false; 76 if (!Operators.OfType<SymbolicClassificationSingleObjectiveTrainingParetoBestSolutionAnalyzer>().Any()) { 77 Operators.Add(new SymbolicClassificationSingleObjectiveTrainingParetoBestSolutionAnalyzer()); 78 changed = true; 79 } 80 if (!Operators.OfType<SymbolicClassificationSingleObjectiveValidationParetoBestSolutionAnalyzer>().Any()) { 81 Operators.Add(new SymbolicClassificationSingleObjectiveValidationParetoBestSolutionAnalyzer()); 82 changed = true; 83 } 84 if (changed) ParameterizeOperators(); 85 } 86 87 private void RegisterEventHandlers() { 88 SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols(); 67 89 } 68 90 … … 82 104 83 105 private void UpdateEstimationLimits() { 84 if (ProblemData.TrainingIndi zes.Any()) {85 var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndi zes).ToList();106 if (ProblemData.TrainingIndices.Any()) { 107 var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).ToList(); 86 108 var mean = targetValues.Average(); 87 109 var range = targetValues.Max() - targetValues.Min(); -
branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs
r7734 r8206 33 33 [Item("SymbolicClassificationSingleObjectiveTrainingParetoBestSolutionAnalyzer", "An operator that collects the training Pareto-best symbolic classification solutions for single objective symbolic classification problems.")] 34 34 [StorableClass] 35 public sealed class SymbolicClassificationSingleObjectiveTrainingParetoBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer<ISymbolicClassificationSolution>, 36 ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator { 37 private const string ProblemDataParameterName = "ProblemData"; 38 private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter"; 39 private const string EstimationLimitsParameterName = "EstimationLimits"; 35 public sealed class SymbolicClassificationSingleObjectiveTrainingParetoBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer<IClassificationProblemData, ISymbolicClassificationSolution> { 40 36 private const string ApplyLinearScalingParameterName = "ApplyLinearScaling"; 41 37 #region parameter properties 42 public ILookupParameter<IClassificationProblemData> ProblemDataParameter {43 get { return (ILookupParameter<IClassificationProblemData>)Parameters[ProblemDataParameterName]; }44 }45 public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {46 get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }47 }48 public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {49 get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }50 }51 38 public IValueParameter<BoolValue> ApplyLinearScalingParameter { 52 39 get { return (IValueParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; } … … 65 52 public SymbolicClassificationSingleObjectiveTrainingParetoBestSolutionAnalyzer() 66 53 : base() { 67 Parameters.Add(new LookupParameter<IClassificationProblemData>(ProblemDataParameterName, "The problem data for the symbolic classification solution."));68 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree."));69 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic classification model."));70 54 Parameters.Add(new ValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the produced symbolic classification solution should be linearly scaled.", new BoolValue(false))); 71 55 } -
branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveValidationParetoBestSolutionAnalyzer.cs
r7734 r8206 33 33 [Item("SymbolicClassificationSingleObjectiveValidationParetoBestSolutionAnalyzer", "An operator that collects the validation Pareto-best symbolic classification solutions for single objective symbolic classification problems.")] 34 34 [StorableClass] 35 public sealed class SymbolicClassificationSingleObjectiveValidationParetoBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer<ISymbolicClassificationSolution, ISymbolicClassificationSingleObjectiveEvaluator, IClassificationProblemData>, 36 ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator { 37 private const string EstimationLimitsParameterName = "EstimationLimits"; 35 public sealed class SymbolicClassificationSingleObjectiveValidationParetoBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer<ISymbolicClassificationSolution, ISymbolicClassificationSingleObjectiveEvaluator, IClassificationProblemData> { 38 36 private const string ApplyLinearScalingParameterName = "ApplyLinearScaling"; 39 37 #region parameter properties 40 public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {41 get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }42 }43 38 public IValueParameter<BoolValue> ApplyLinearScalingParameter { 44 39 get { return (IValueParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; } … … 57 52 public SymbolicClassificationSingleObjectiveValidationParetoBestSolutionAnalyzer() 58 53 : base() { 59 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic classification model."));60 54 Parameters.Add(new ValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the produced symbolic classification solution should be linearly scaled.", new BoolValue(false))); 61 55 }
Note: See TracChangeset
for help on using the changeset viewer.