Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/03/09 15:00:23 (15 years ago)
Author:
gkronber
Message:

this is the remaining part of changeset r2327.
Applied changes in modeling plugins that are necessary for the new model analyzer (#722)

  • predictor has properties for the lower and upper limit of the predicted value
  • added views for predictors that show the limits (also added a new view for GeneticProgrammingModel that shows the size and height of the model)
  • Reintroduced TreeEvaluatorInjectors that read a PunishmentFactor and calculate the lower and upper limits for estimated values (limits are set in the tree evaluators)
  • Added operators to create Predictors. Changed modeling algorithms to use the predictors for the calculation of final model qualities and variable impacts (to be compatible with the new model analyzer the predictors use a very large PunishmentFactor)
  • replaced all private implementations of double.IsAlmost and use HL.Commons instead (see #733 r2324)
  • Implemented operator SolutionExtractor and moved BestSolutionStorer from HL.Logging to HL.Modeling (fixes #734)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Predictor.cs

    r2317 r2328  
    3131
    3232namespace HeuristicLab.GP.StructureIdentification {
    33   public class Predictor : ItemBase, IPredictor {
     33  public class Predictor : PredictorBase {
    3434    private ITreeEvaluator treeEvaluator;
    35    
    36 
    37     public Predictor() : base() { } // for persistence
    38     public Predictor(ITreeEvaluator evaluator, IGeneticProgrammingModel tree)
    39       : base() {
    40       this.treeEvaluator = evaluator;
    41       this.functionTree = tree;
    42     }
    4335
    4436    private IGeneticProgrammingModel functionTree;
     
    4638      get { return functionTree; }
    4739    }
     40    public Predictor() : base() { } // for persistence
     41    public Predictor(ITreeEvaluator evaluator, IGeneticProgrammingModel tree, double lowerPredictionLimit, double upperPredictionLimit)
     42      : base(lowerPredictionLimit, upperPredictionLimit) {
     43      this.treeEvaluator = evaluator;
     44      this.functionTree = tree;
     45    }
    4846
    49     public double[] Predict(Dataset input, int start, int end) {
     47    public override double[] Predict(Dataset input, int start, int end) {
     48      treeEvaluator.UpperEvaluationLimit = UpperPredictionLimit;
     49      treeEvaluator.LowerEvaluationLimit = LowerPredictionLimit;
     50
    5051      if (start < 0 || end <= start) throw new ArgumentException("start must be larger than zero and strictly smaller than end");
    5152      if (end > input.Rows) throw new ArgumentOutOfRangeException("number of rows in input is smaller then end");
     
    5960
    6061    public override IView CreateView() {
    61       return functionTree.CreateView();
     62      return new PredictorView(this);
    6263    }
    6364
Note: See TracChangeset for help on using the changeset viewer.