Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/21/11 00:19:08 (13 years ago)
Author:
mkommend
Message:

#1418: Changed data type of estimation limits and corrected some bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs

    r5759 r5770  
    3434    private const int InitialMaximumTreeDepth = 8;
    3535    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.";
    4038
    4139    #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]; }
    4742    }
    4843    #endregion
    4944    #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; }
    5547    }
    5648    #endregion
     
    6254    public SymbolicClassificationMultiObjectiveProblem()
    6355      : 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()));
    6657
    6758      Maximization = new BoolArray(new bool[] { false, false });
     
    8475        var mean = targetValues.Average();
    8576        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;
    8879      }
    8980    }
     
    9687    protected new void ParameterizeOperators() {
    9788      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        }
    10294      }
    10395    }
Note: See TracChangeset for help on using the changeset viewer.