Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/16/11 17:13:33 (14 years ago)
Author:
gkronber
Message:

#1418 Added upper and lower estimation bounds for symbolic classification and regression.

Location:
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4
Files:
8 edited

Legend:

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

    r5716 r5720  
    9797      base.ParameterizeOperators();
    9898      var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators);
    99       foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedEvaluator<IClassificationProblemData>>()) {
     99      foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) {
    100100        op.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameterName;
    101101        op.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameterName;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs

    r5685 r5720  
    4141    private const string ProblemDataParameterName = "ProblemData";
    4242    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
     43    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
     44    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
    4345    #region parameter properties
    4446    public ILookupParameter<IClassificationProblemData> ProblemDataParameter {
     
    4749    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
    4850      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
     51    }
     52    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
     53      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
     54    }
     55
     56    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
     57      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
    4958    }
    5059    #endregion
     
    5665      get { return SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; }
    5766    }
     67    public DoubleValue UpperEstimationLimit {
     68      get { return UpperEstimationLimitParameter.ActualValue; }
     69    }
     70    public DoubleValue LowerEstimationLimit {
     71      get { return LowerEstimationLimitParameter.ActualValue; }
     72    }
    5873    #endregion
     74
    5975    [StorableConstructor]
    6076    private SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     
    6480      Parameters.Add(new LookupParameter<IClassificationProblemData>(ProblemDataParameterName, "The problem data for the symbolic classification solution."));
    6581      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree."));
     82      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic classification model."));
     83      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic classification model."));
    6684    }
    6785    public override IDeepCloneable Clone(Cloner cloner) {
     
    7391      double[] classValues;
    7492      double[] thresholds;
    75       var estimatedValues = SymbolicDataAnalysisTreeInterpreter.GetSymbolicExpressionTreeValues(bestTree, ProblemData.Dataset, ProblemData.TrainingIndizes);
     93      var estimatedValues = SymbolicDataAnalysisTreeInterpreter.GetSymbolicExpressionTreeValues(bestTree, ProblemData.Dataset, ProblemData.TrainingIndizes)
     94        .LimitToRange(LowerEstimationLimit.Value, UpperEstimationLimit.Value);
    7695      var targetValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes);
    7796      AccuracyMaximizationThresholdCalculator.CalculateThresholds(ProblemData, estimatedValues, targetValues, out classValues, out thresholds);
    78       var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, classValues, thresholds);
     97      var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, classValues, thresholds, LowerEstimationLimit.Value, UpperEstimationLimit.Value);
    7998      return new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemData);
    8099    }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer.cs

    r5685 r5720  
    3737  [Item("SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic classification solution for multi objective symbolic classification problems.")]
    3838  [StorableClass]
    39   public sealed class SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer<ISymbolicClassificationSolution, ISymbolicClassificationMultiObjectiveEvaluator, IClassificationProblemData> {
     39  public sealed class SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer<ISymbolicClassificationSolution, ISymbolicClassificationMultiObjectiveEvaluator, IClassificationProblemData>,
     40  ISymbolicDataAnalysisBoundedOperator {
     41    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
     42    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
     43
     44    #region parameter properties
     45    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
     46      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
     47    }
     48
     49    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
     50      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
     51    }
     52    #endregion
     53
     54    #region properties
     55    public DoubleValue UpperEstimationLimit {
     56      get { return UpperEstimationLimitParameter.ActualValue; }
     57    }
     58    public DoubleValue LowerEstimationLimit {
     59      get { return LowerEstimationLimitParameter.ActualValue; }
     60    }
     61    #endregion
    4062    [StorableConstructor]
    4163    private SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     
    4365    public SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer()
    4466      : base() {
     67      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic classification model."));
     68      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic classification model."));
    4569    }
    4670    public override IDeepCloneable Clone(Cloner cloner) {
     
    5276      double[] thresholds;
    5377      // calculate thresholds on the whole training set even for the validation best solution
    54       var estimatedValues = SymbolicDataAnalysisTreeInterpreter.GetSymbolicExpressionTreeValues(bestTree, ProblemData.Dataset, ProblemData.TrainingIndizes);
     78      var estimatedValues = SymbolicDataAnalysisTreeInterpreter.GetSymbolicExpressionTreeValues(bestTree, ProblemData.Dataset, ProblemData.TrainingIndizes)
     79        .LimitToRange(LowerEstimationLimit.Value, UpperEstimationLimit.Value);
    5580      var targetClassValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes);
    5681      AccuracyMaximizationThresholdCalculator.CalculateThresholds(ProblemData, estimatedValues, targetClassValues, out classValues, out thresholds);
    57       var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, classValues, thresholds);
     82      var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, classValues, thresholds, LowerEstimationLimit.Value, UpperEstimationLimit.Value);
    5883      return new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemData);
    5984    }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs

    r5716 r5720  
    9696      base.ParameterizeOperators();
    9797      var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators);
    98       foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedEvaluator<IClassificationProblemData>>()) {
     98      foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) {
    9999        op.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameterName;
    100100        op.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameterName;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer.cs

    r5685 r5720  
    3838  [StorableClass]
    3939  public sealed class SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<ISymbolicClassificationSolution>,
    40     ISymbolicDataAnalysisInterpreterOperator {
     40    ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator {
    4141    private const string ProblemDataParameterName = "ProblemData";
    4242    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
     43    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
     44    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
    4345    #region parameter properties
    4446    public ILookupParameter<IClassificationProblemData> ProblemDataParameter {
     
    4749    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
    4850      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
     51    }
     52    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
     53      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
     54    }
     55
     56    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
     57      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
    4958    }
    5059    #endregion
     
    5665      get { return SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; }
    5766    }
     67    public DoubleValue UpperEstimationLimit {
     68      get { return UpperEstimationLimitParameter.ActualValue; }
     69    }
     70    public DoubleValue LowerEstimationLimit {
     71      get { return LowerEstimationLimitParameter.ActualValue; }
     72    }
    5873    #endregion
     74
    5975    [StorableConstructor]
    6076    private SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     
    6480      Parameters.Add(new LookupParameter<IClassificationProblemData>(ProblemDataParameterName, "The problem data for the symbolic classification solution."));
    6581      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree."));
     82      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic classification model."));
     83      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic classification model."));
    6684    }
    6785    public override IDeepCloneable Clone(Cloner cloner) {
     
    7290      double[] classValues;
    7391      double[] thresholds;
    74       var estimatedValues = SymbolicDataAnalysisTreeInterpreter.GetSymbolicExpressionTreeValues(bestTree, ProblemData.Dataset, ProblemData.TrainingIndizes);
     92      var estimatedValues = SymbolicDataAnalysisTreeInterpreter.GetSymbolicExpressionTreeValues(bestTree, ProblemData.Dataset, ProblemData.TrainingIndizes)
     93        .LimitToRange(LowerEstimationLimit.Value, UpperEstimationLimit.Value);
    7594      var targetValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes);
    7695      AccuracyMaximizationThresholdCalculator.CalculateThresholds(ProblemData, estimatedValues, targetValues, out classValues, out thresholds);
    77       var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, classValues, thresholds);
     96      var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, classValues, thresholds, LowerEstimationLimit.Value, UpperEstimationLimit.Value);
    7897      return new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemData);
    7998    }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer.cs

    r5685 r5720  
    3737  [Item("SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic classification solution for single objective symbolic classification problems.")]
    3838  [StorableClass]
    39   public sealed class SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<ISymbolicClassificationSolution, ISymbolicClassificationSingleObjectiveEvaluator, IClassificationProblemData> {
     39  public sealed class SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<ISymbolicClassificationSolution, ISymbolicClassificationSingleObjectiveEvaluator, IClassificationProblemData>,
     40  ISymbolicDataAnalysisBoundedOperator {
     41    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
     42    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
     43
     44    #region parameter properties
     45    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
     46      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
     47    }
     48
     49    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
     50      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
     51    }
     52    #endregion
     53
     54    #region properties
     55    public DoubleValue UpperEstimationLimit {
     56      get { return UpperEstimationLimitParameter.ActualValue; }
     57    }
     58    public DoubleValue LowerEstimationLimit {
     59      get { return LowerEstimationLimitParameter.ActualValue; }
     60    }
     61    #endregion
    4062    [StorableConstructor]
    4163    private SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     
    4365    public SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer()
    4466      : base() {
     67      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic classification model."));
     68      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic classification model."));
    4569    }
    4670    public override IDeepCloneable Clone(Cloner cloner) {
     
    5276      double[] thresholds;
    5377      // calculate thresholds on the whole training set even for the validation best solution
    54       var estimatedValues = SymbolicDataAnalysisTreeInterpreter.GetSymbolicExpressionTreeValues(bestTree, ProblemData.Dataset, ProblemData.TrainingIndizes);
     78      var estimatedValues = SymbolicDataAnalysisTreeInterpreter.GetSymbolicExpressionTreeValues(bestTree, ProblemData.Dataset, ProblemData.TrainingIndizes)
     79        .LimitToRange(LowerEstimationLimit.Value, UpperEstimationLimit.Value);
    5580      var targetClassValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes);
    5681      AccuracyMaximizationThresholdCalculator.CalculateThresholds(ProblemData, estimatedValues, targetClassValues, out classValues, out thresholds);
    57       var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, classValues, thresholds);
     82      var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, classValues, thresholds, LowerEstimationLimit.Value, UpperEstimationLimit.Value);
    5883      return new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemData);
    5984    }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationModel.cs

    r5649 r5720  
    3939  [Item(Name = "SymbolicClassificationModel", Description = "Represents a symbolic classification model.")]
    4040  public class SymbolicClassificationModel : SymbolicDataAnalysisModel, ISymbolicClassificationModel {
    41 
    4241    [StorableConstructor]
    4342    protected SymbolicClassificationModel(bool deserializing) : base(deserializing) { }
     
    5352    }
    5453
    55     #region IClassificationModel Members
    56 
    5754    public IEnumerable<double> GetEstimatedClassValues(Dataset dataset, IEnumerable<int> rows) {
    5855      return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows);
    5956    }
    60 
    61     #endregion
    6257  }
    6358}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs

    r5678 r5720  
    5555      set { classValues = value.ToArray(); }
    5656    }
     57    [Storable]
     58    private double lowerEstimationLimit;
     59    public double LowerEstimationLimit { get { return lowerEstimationLimit; } }
     60    [Storable]
     61    private double upperEstimationLimit;
     62    public double UpperEstimationLimit { get { return upperEstimationLimit; } }
     63
    5764    [StorableConstructor]
    5865    protected SymbolicDiscriminantFunctionClassificationModel(bool deserializing) : base(deserializing) { }
     
    6168      classValues = (double[])original.classValues.Clone();
    6269      thresholds = (double[])original.thresholds.Clone();
     70      lowerEstimationLimit = original.lowerEstimationLimit;
     71      upperEstimationLimit = original.upperEstimationLimit;
    6372    }
    64     public SymbolicDiscriminantFunctionClassificationModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IEnumerable<double> classValues, IEnumerable<double> thresholds)
     73    public SymbolicDiscriminantFunctionClassificationModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
     74      IEnumerable<double> classValues, IEnumerable<double> thresholds,
     75      double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue)
    6576      : base(tree, interpreter) {
    6677      this.classValues = classValues.ToArray();
    6778      this.thresholds = thresholds.ToArray();
     79      this.lowerEstimationLimit = lowerEstimationLimit;
     80      this.upperEstimationLimit = upperEstimationLimit;
    6881    }
    6982
     
    94107      if (listener != null) listener(this, e);
    95108    }
    96     #endregion   
     109    #endregion
    97110  }
    98111}
Note: See TracChangeset for help on using the changeset viewer.