Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5720


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
Files:
1 added
1 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Common/3.3/EnumerableStatisticExtensions.cs

    r5699 r5720  
    106106    public static IEnumerable<double> LimitToRange(this IEnumerable<double> values, double min, double max) {
    107107      foreach (var x in values) {
    108         if (double.IsNaN(x)) yield return max;
     108        if (double.IsNaN(x)) yield return (max + min) / 2.0;
    109109        else if (x < min) yield return min;
    110110        else if (x > max) yield return max;
  • 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}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs

    r5716 r5720  
    9898      base.ParameterizeOperators();
    9999      var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators);
    100       foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedEvaluator<IRegressionProblemData>>()) {
     100      foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) {
    101101        op.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameterName;
    102102        op.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameterName;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveTrainingBestSolutionAnalyzer.cs

    r5685 r5720  
    4141    private const string ProblemDataParameterName = "ProblemData";
    4242    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
    43 
     43    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
     44    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
    4445    #region parameter properties
    4546    public ILookupParameter<IRegressionProblemData> ProblemDataParameter {
     
    4849    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
    4950      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]; }
    5058    }
    5159    #endregion
     
    5866      get { return SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; }
    5967    }
     68    public DoubleValue UpperEstimationLimit {
     69      get { return UpperEstimationLimitParameter.ActualValue; }
     70    }
     71    public DoubleValue LowerEstimationLimit {
     72      get { return LowerEstimationLimitParameter.ActualValue; }
     73    }
    6074    #endregion
    6175
     
    6781      Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName, "The problem data for the symbolic regression solution."));
    6882      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree."));
     83      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic regression model."));
     84      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic regression model."));
    6985    }
    7086
     
    7490
    7591    protected override ISymbolicRegressionSolution CreateSolution(ISymbolicExpressionTree bestTree, double[] bestQuality) {
    76       return new SymbolicRegressionSolution(new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreter), ProblemData);
     92      var model = new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreter, LowerEstimationLimit.Value, UpperEstimationLimit.Value);
     93      return new SymbolicRegressionSolution(model, ProblemData);
    7794    }
    7895  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveValidationBestSolutionAnalyzer.cs

    r5685 r5720  
    3737  [Item("SymbolicRegressionMultiObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic regression solution for multi objective symbolic regression problems.")]
    3838  [StorableClass]
    39   public sealed class SymbolicRegressionMultiObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer<ISymbolicRegressionSolution, ISymbolicRegressionMultiObjectiveEvaluator, IRegressionProblemData> {
     39  public sealed class SymbolicRegressionMultiObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer<ISymbolicRegressionSolution, ISymbolicRegressionMultiObjectiveEvaluator, IRegressionProblemData>,
     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 SymbolicRegressionMultiObjectiveValidationBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     
    4365    public SymbolicRegressionMultiObjectiveValidationBestSolutionAnalyzer()
    4466      : base() {
     67      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic regression model."));
     68      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic regression model."));
    4569    }
    4670    public override IDeepCloneable Clone(Cloner cloner) {
     
    4973
    5074    protected override ISymbolicRegressionSolution CreateSolution(ISymbolicExpressionTree bestTree, double[] bestQuality) {
    51       return new SymbolicRegressionSolution(new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreter), ProblemData);
     75      var model = new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreter, LowerEstimationLimit.Value, UpperEstimationLimit.Value);
     76      return new SymbolicRegressionSolution(model, ProblemData);
    5277    }
    5378  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs

    r5716 r5720  
    9898      base.ParameterizeOperators();
    9999      var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators);
    100       foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedEvaluator<IRegressionProblemData>>()) {
     100      foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) {
    101101        op.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameterName;
    102102        op.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameterName;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveTrainingBestSolutionAnalyzer.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<IRegressionProblemData> ProblemDataParameter {
     
    4850      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
    4951    }
     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]; }
     58    }
    5059    #endregion
     60
    5161    #region properties
    5262    public IRegressionProblemData ProblemData {
     
    5565    public ISymbolicDataAnalysisExpressionTreeInterpreter SymbolicDataAnalysisTreeInterpreter {
    5666      get { return SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; }
     67    }
     68    public DoubleValue UpperEstimationLimit {
     69      get { return UpperEstimationLimitParameter.ActualValue; }
     70    }
     71    public DoubleValue LowerEstimationLimit {
     72      get { return LowerEstimationLimitParameter.ActualValue; }
    5773    }
    5874    #endregion
     
    6480      Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName, "The problem data for the symbolic regression 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 regression model."));
     83      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic regression model."));
    6684    }
    6785    public override IDeepCloneable Clone(Cloner cloner) {
     
    7088
    7189    protected override ISymbolicRegressionSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) {
    72       return new SymbolicRegressionSolution(new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreter), ProblemData);
     90      var model = new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreter, LowerEstimationLimit.Value, UpperEstimationLimit.Value);
     91      return new SymbolicRegressionSolution(model, ProblemData);
    7392    }
    7493  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveValidationBestSolutionAnalyzer.cs

    r5685 r5720  
    3737  [Item("SymbolicRegressionSingleObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic regression solution for single objective symbolic regression problems.")]
    3838  [StorableClass]
    39   public sealed class SymbolicRegressionSingleObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<ISymbolicRegressionSolution, ISymbolicRegressionSingleObjectiveEvaluator, IRegressionProblemData> {
     39  public sealed class SymbolicRegressionSingleObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<ISymbolicRegressionSolution, ISymbolicRegressionSingleObjectiveEvaluator, IRegressionProblemData>,
     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
     62
    4063    [StorableConstructor]
    4164    private SymbolicRegressionSingleObjectiveValidationBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     
    4366    public SymbolicRegressionSingleObjectiveValidationBestSolutionAnalyzer()
    4467      : base() {
     68      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic regression model."));
     69      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic regression model."));
    4570    }
     71
    4672    public override IDeepCloneable Clone(Cloner cloner) {
    4773      return new SymbolicRegressionSingleObjectiveValidationBestSolutionAnalyzer(this, cloner);
     
    4975
    5076    protected override ISymbolicRegressionSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) {
    51       return new SymbolicRegressionSolution(new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreter), ProblemData);
     77      var model = new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreter, LowerEstimationLimit.Value, UpperEstimationLimit.Value);
     78      return new SymbolicRegressionSolution(model, ProblemData);
    5279    }
    5380  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs

    r5649 r5720  
    3939  [Item(Name = "SymbolicRegressionModel", Description = "Represents a symbolic regression model.")]
    4040  public class SymbolicRegressionModel : SymbolicDataAnalysisModel, ISymbolicRegressionModel {
     41    [Storable]
     42    private double lowerEstimationLimit;
     43    [Storable]
     44    private double upperEstimationLimit;
    4145
    4246    [StorableConstructor]
     
    4448    protected SymbolicRegressionModel(SymbolicRegressionModel original, Cloner cloner)
    4549      : base(original, cloner) {
     50      this.lowerEstimationLimit = original.lowerEstimationLimit;
     51      this.upperEstimationLimit = original.upperEstimationLimit;
    4652    }
    47     public SymbolicRegressionModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter)
     53    public SymbolicRegressionModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
     54      double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue)
    4855      : base(tree, interpreter) {
     56      this.lowerEstimationLimit = lowerEstimationLimit;
     57      this.upperEstimationLimit = upperEstimationLimit;
    4958    }
    5059
     
    5463
    5564    public IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows) {
    56       return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows);
     65      return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows)
     66        .LimitToRange(lowerEstimationLimit, upperEstimationLimit);
    5767    }
    5868  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs

    r5717 r5720  
    3939  [Item(Name = "SymbolicRegressionSolution", Description = "Represents a symbolic regression solution (model + data) and attributes of the solution like accuracy and complexity.")]
    4040  public sealed class SymbolicRegressionSolution : RegressionSolution, ISymbolicRegressionSolution {
    41     #region ISymbolicRegressionSolution Members
    42 
    4341    public new ISymbolicRegressionModel Model {
    4442      get { return (ISymbolicRegressionModel)base.Model; }
     
    4846      get { return (ISymbolicDataAnalysisModel)base.Model; }
    4947    }
    50 
    51     #endregion
    5248
    5349    [StorableConstructor]
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs

    r5689 r5720  
    3535  [StorableClass]
    3636  public abstract class SymbolicDataAnalysisEvaluator<T> : SingleSuccessorOperator,
    37     ISymbolicDataAnalysisBoundedEvaluator<T>, ISymbolicDataAnalysisInterpreterOperator
     37    ISymbolicDataAnalysisEvaluator<T>, ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator
    3838  where T : class, IDataAnalysisProblemData {
    3939    private const string RandomParameterName = "Random";
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r5685 r5720  
    119119    </Compile>
    120120    <Compile Include="Analyzers\SymbolicDataAnalysisVariableFrequencyAnalyzer.cs" />
     121    <Compile Include="Interfaces\ISymbolicDataAnalysisBoundedOperator.cs" />
    121122    <Compile Include="Interfaces\ISymbolicDataAnalysisExpressionTreeInterpreter.cs" />
    122123    <Compile Include="SymbolicDataAnalysisExpressionTreeCreator.cs" />
     
    178179    <Compile Include="Interfaces\ISymbolicDataAnalysisInterpreterOperator.cs" />
    179180    <Compile Include="Interfaces\ISymbolicDataAnalysisMultiObjectiveEvaluator.cs" />
    180     <Compile Include="Interfaces\ISymbolicDataAnalysisBoundedEvaluator.cs" />
    181181    <Compile Include="Interfaces\ISymbolicDataAnalysisEvaluator.cs" />
    182182    <Compile Include="Interfaces\ISymbolicDataAnalysisGrammar.cs" />
Note: See TracChangeset for help on using the changeset viewer.