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/M5regLeaf.cs

    r15830 r16847  
    2626using HeuristicLab.Common;
    2727using HeuristicLab.Core;
    28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2928using HeuristicLab.Problems.DataAnalysis;
     29using HEAL.Attic;
    3030
    3131namespace HeuristicLab.Algorithms.DataAnalysis {
    32   [StorableClass]
    33   [Item("M5regLeaf", "A leaf type that uses linear models as leaf models. This is the standard for M5' regression")]
     32  [StorableType("0AED959D-78C3-4927-BDCF-473D0AEE32AA")]
     33  [Item("M5regLeaf", "A leaf type that uses regularized linear models as leaf models.")]
    3434  public class M5regLeaf : LeafBase {
    3535    #region Constructors & Cloning
    3636    [StorableConstructor]
    37     private M5regLeaf(bool deserializing) : base(deserializing) { }
     37    private M5regLeaf(StorableConstructorFlag _) : base(_) { }
    3838    private M5regLeaf(M5regLeaf original, Cloner cloner) : base(original, cloner) { }
    3939    public M5regLeaf() { }
     
    4747      get { return true; }
    4848    }
    49     public override IRegressionModel Build(IRegressionProblemData pd, IRandom random, CancellationToken cancellationToken, out int noParameters) {
     49
     50    public override IRegressionModel Build(IRegressionProblemData pd, IRandom random, CancellationToken cancellationToken, out int numberOfParameters) {
    5051      if (pd.Dataset.Rows < MinLeafSize(pd)) throw new ArgumentException("The number of training instances is too small to create a linear model");
    51       noParameters = pd.AllowedInputVariables.Count() + 1;
     52      numberOfParameters = pd.AllowedInputVariables.Count() + 1;
    5253
    5354      double x1, x2;
    5455      var coeffs = ElasticNetLinearRegression.CalculateModelCoefficients(pd, 1, 0.2, out x1, out x2);
    55       noParameters = coeffs.Length;
     56      numberOfParameters = coeffs.Length;
    5657      return ElasticNetLinearRegression.CreateSymbolicSolution(coeffs, pd).Model;
    5758    }
Note: See TracChangeset for help on using the changeset viewer.