Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/08/18 08:46:40 (6 years ago)
Author:
bwerth
Message:

#2847 adapted project to new rep structure; major changes to interfaces; restructures splitting and pruning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/LeafTypes/LogisticLeaf.cs

    r15614 r15830  
    3333  [StorableClass]
    3434  [Item("LogisticLeaf", "A leaf type that uses linear models with a logistic dampening as leaf models. Dampening reduces prediction values far outside the observed target values.")]
    35   public class LogisticLeaf : ParameterizedNamedItem, ILeafModel {
     35  public class LogisticLeaf : LeafBase {
    3636    private const string DampeningParameterName = "Dampening";
    3737    public IFixedValueParameter<DoubleValue> DampeningParameter {
     
    5555
    5656    #region IModelType
    57     public bool ProvidesConfidence {
     57    public override bool ProvidesConfidence {
    5858      get { return true; }
    5959    }
    60     public IRegressionModel Build(IRegressionProblemData pd, IRandom random, CancellationToken cancellationToken, out int noParameters) {
    61       if (pd.Dataset.Rows < MinLeafSize(pd)) throw new ArgumentException("The number of training instances is too small to create a linear model");
    62       double rmse, cvRmse;
    63       noParameters = pd.AllowedInputVariables.Count() + 1;
    64       return new DampenedLinearModel(PreconstructedLinearModel.CreateConfidenceLinearModel(pd, out rmse, out cvRmse), pd, Dampening);
     60    public override IRegressionModel Build(IRegressionProblemData pd, IRandom random, CancellationToken cancellationToken, out int noParameters) {
     61      var res = (IConfidenceRegressionModel)new LinearLeaf().Build(pd, random, cancellationToken, out noParameters);
     62      return new DampenedLinearModel(res, pd, Dampening);
    6563    }
    6664
    67     public int MinLeafSize(IRegressionProblemData pd) {
     65    public override int MinLeafSize(IRegressionProblemData pd) {
    6866      return pd.AllowedInputVariables.Count() + 2;
    6967    }
Note: See TracChangeset for help on using the changeset viewer.