Changeset 13921 for trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/ConstantModel.cs
- Timestamp:
- 06/19/16 19:56:11 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/ConstantModel.cs
r13154 r13921 32 32 [Item("Constant Model", "A model that always returns the same constant value regardless of the presented input data.")] 33 33 public class ConstantModel : NamedItem, IRegressionModel, IClassificationModel, ITimeSeriesPrognosisModel, IStringConvertibleValue { 34 public IEnumerable<string> VariablesUsedForPrediction { get { return Enumerable.Empty<string>(); } } 35 34 36 [Storable] 35 private double constant; 37 private readonly string targetVariable; 38 public string TargetVariable { 39 get { return targetVariable; } 40 } 41 42 [Storable] 43 private readonly double constant; 36 44 public double Constant { 37 45 get { return constant; } … … 44 52 : base(original, cloner) { 45 53 this.constant = original.constant; 54 this.targetVariable = original.targetVariable; 46 55 } 56 47 57 public override IDeepCloneable Clone(Cloner cloner) { return new ConstantModel(this, cloner); } 48 58 49 public ConstantModel(double constant )59 public ConstantModel(double constant, string targetVariable = "Target") 50 60 : base() { 51 61 this.name = ItemName; … … 53 63 this.constant = constant; 54 64 this.ReadOnly = true; // changing a constant regression model is not supported 65 this.targetVariable = targetVariable; 55 66 } 56 67
Note: See TracChangeset
for help on using the changeset viewer.