Changeset 15830 for branches/M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/LeafTypes/LogisticLeaf.cs
- Timestamp:
- 03/08/18 08:46:40 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/LeafTypes/LogisticLeaf.cs
r15614 r15830 33 33 [StorableClass] 34 34 [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 { 36 36 private const string DampeningParameterName = "Dampening"; 37 37 public IFixedValueParameter<DoubleValue> DampeningParameter { … … 55 55 56 56 #region IModelType 57 public bool ProvidesConfidence {57 public override bool ProvidesConfidence { 58 58 get { return true; } 59 59 } 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); 65 63 } 66 64 67 public int MinLeafSize(IRegressionProblemData pd) {65 public override int MinLeafSize(IRegressionProblemData pd) { 68 66 return pd.AllowedInputVariables.Count() + 2; 69 67 }
Note: See TracChangeset
for help on using the changeset viewer.