Ignore:
Timestamp:
04/19/19 13:06:11 (4 months ago)
Author:
gkronber
Message:

#2847: made some minor changes while reviewing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/LeafTypes/ConstantLeaf.cs

    r15830 r16847  
    2525using HeuristicLab.Common;
    2626using HeuristicLab.Core;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2827using HeuristicLab.Problems.DataAnalysis;
     28using HEAL.Attic;
    2929
    3030namespace HeuristicLab.Algorithms.DataAnalysis {
    31   [StorableClass]
     31  [StorableType("F3E94907-C5FF-4658-A870-8013C61DD2E1")]
    3232  [Item("ConstantLeaf", "A leaf type that uses constant models as leaf models")]
    3333  public class ConstantLeaf : LeafBase {
    3434    #region Constructors & Cloning
    3535    [StorableConstructor]
    36     protected ConstantLeaf(bool deserializing) : base(deserializing) { }
     36    protected ConstantLeaf(StorableConstructorFlag _) : base(_) { }
    3737    protected ConstantLeaf(ConstantLeaf original, Cloner cloner) : base(original, cloner) { }
    3838    public ConstantLeaf() { }
     
    4646      get { return false; }
    4747    }
    48     public override IRegressionModel Build(IRegressionProblemData pd, IRandom random, CancellationToken cancellationToken, out int noParameters) {
     48    public override IRegressionModel Build(IRegressionProblemData pd, IRandom random, CancellationToken cancellationToken, out int numberOfParameters) {
    4949      if (pd.Dataset.Rows < MinLeafSize(pd)) throw new ArgumentException("The number of training instances is too small to create a linear model");
    50       noParameters = 1;
     50      numberOfParameters = 1;
    5151      return new PreconstructedLinearModel(pd.Dataset.GetDoubleValues(pd.TargetVariable).Average(), pd.TargetVariable);
    5252    }
Note: See TracChangeset for help on using the changeset viewer.