Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/23/10 14:28:07 (15 years ago)
Author:
gkronber
Message:

Added upper and lower estimation limits. #938 (Data types and operators for regression problems)

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs

    r3462 r3513  
    5050      }
    5151    }
     52    [Storable]
     53    private double lowerEstimationLimit;
     54    public double LowerEstimationLimit {
     55      get { return lowerEstimationLimit; }
     56      set {
     57        if (lowerEstimationLimit != value) {
     58          lowerEstimationLimit = value;
     59          OnEstimatedValuesChanged(EventArgs.Empty);
     60        }
     61      }
     62    }
     63
     64    [Storable]
     65    private double upperEstimationLimit;
     66    public double UpperEstimationLimit {
     67      get { return upperEstimationLimit; }
     68      set {
     69        if (upperEstimationLimit != value) {
     70          upperEstimationLimit = value;
     71          OnEstimatedValuesChanged(EventArgs.Empty);
     72        }
     73      }
     74    }
    5275
    5376    public abstract IEnumerable<double> EstimatedValues { get; }
     
    5679
    5780    protected DataAnalysisSolution() : base() { }
    58     protected DataAnalysisSolution(DataAnalysisProblemData problemData)
     81    protected DataAnalysisSolution(DataAnalysisProblemData problemData) : this(problemData, double.NegativeInfinity, double.PositiveInfinity) { }
     82    protected DataAnalysisSolution(DataAnalysisProblemData problemData, double lowerEstimationLimit, double upperEstimationLimit)
    5983      : this() {
    6084      this.problemData = problemData;
     85      this.lowerEstimationLimit = lowerEstimationLimit;
     86      this.upperEstimationLimit = upperEstimationLimit;
    6187      Initialize();
    6288    }
     
    74100      // don't clone the problem data!
    75101      clone.problemData = problemData;
     102      clone.lowerEstimationLimit = lowerEstimationLimit;
     103      clone.upperEstimationLimit = upperEstimationLimit;
    76104      clone.Initialize();
    77105      return clone;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs

    r3491 r3513  
    3434  [Item("SimpleArithmeticExpressionInterpreter", "Interpreter for arithmetic symbolic expression trees including function calls.")]
    3535  // not thread safe!
    36   public class SimpleArithmeticExpressionInterpreter : Item, ISymbolicExpressionTreeInterpreter {
     36  public class SimpleArithmeticExpressionInterpreter : NamedItem, ISymbolicExpressionTreeInterpreter {
    3737    private class OpCodes {
    3838      public const byte Add = 1;
     
    4747
    4848    private const int ARGUMENT_STACK_SIZE = 1024;
     49
    4950    private Dataset dataset;
    5051    private int row;
    5152    private Instruction[] code;
    5253    private int pc;
     54
     55    public SimpleArithmeticExpressionInterpreter()
     56      : base() {
     57    }
    5358
    5459    public IEnumerable<double> GetSymbolicExpressionTreeValues(SymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {
     
    6166        pc = 0;
    6267        argStackPointer = 0;
    63         var estimatedValue = Evaluate();
    64         if (double.IsNaN(estimatedValue) || double.IsInfinity(estimatedValue)) yield return 0.0;
    65         else yield return estimatedValue;
     68        yield return Evaluate();
    6669      }
    6770    }
Note: See TracChangeset for help on using the changeset viewer.