Changeset 5770 for branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs
- Timestamp:
- 03/21/11 00:19:08 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs
r5759 r5770 34 34 private const int InitialMaximumTreeDepth = 8; 35 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."; 36 private const string EstimationLimitsParameterName = "EstimationLimits"; 37 private const string EstimationLimitsParameterDescription = "The lower and upper limit for the estimated value that can be returned by the symbolic classification model."; 40 38 41 39 #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]; } 40 public IFixedValueParameter<DoubleLimit> EstimationLimitsParameter { 41 get { return (IFixedValueParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 47 42 } 48 43 #endregion 49 44 #region properties 50 public DoubleValue LowerEstimationLimit { 51 get { return LowerEstimationLimitParameter.Value; } 52 } 53 public DoubleValue UpperEstimationLimit { 54 get { return UpperEstimationLimitParameter.Value; } 45 public DoubleLimit EstimationLimits { 46 get { return EstimationLimitsParameter.Value; } 55 47 } 56 48 #endregion … … 62 54 public SymbolicClassificationMultiObjectiveProblem() 63 55 : base(new ClassificationProblemData(), new SymbolicClassificationMultiObjectiveMeanSquaredErrorTreeSizeEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { 64 Parameters.Add(new FixedValueParameter<DoubleValue>(LowerEstimationLimitParameterName, LowerEstimationLimitParameterDescription, new DoubleValue())); 65 Parameters.Add(new FixedValueParameter<DoubleValue>(UpperEstimationLimitParameterName, UpperEstimationLimitParameterDescription, new DoubleValue())); 56 Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription, new DoubleLimit())); 66 57 67 58 Maximization = new BoolArray(new bool[] { false, false }); … … 84 75 var mean = targetValues.Average(); 85 76 var range = targetValues.Max() - targetValues.Min(); 86 UpperEstimationLimit.Value= mean + PunishmentFactor * range;87 LowerEstimationLimit.Value= mean - PunishmentFactor * range;77 EstimationLimits.Upper = mean + PunishmentFactor * range; 78 EstimationLimits.Lower = mean - PunishmentFactor * range; 88 79 } 89 80 } … … 96 87 protected new void ParameterizeOperators() { 97 88 base.ParameterizeOperators(); 98 var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators); 99 foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) { 100 op.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameterName; 101 op.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameterName; 89 if (Parameters.ContainsKey(EstimationLimitsParameterName)) { 90 var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators); 91 foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) { 92 op.EstimationLimitsParameter.ActualName = EstimationLimitsParameterName; 93 } 102 94 } 103 95 }
Note: See TracChangeset
for help on using the changeset viewer.