- Timestamp:
- 06/19/16 19:56:11 (8 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs
r13100 r13921 33 33 [Obsolete] 34 34 public class ConstantRegressionModel : NamedItem, IRegressionModel, IStringConvertibleValue { 35 public IEnumerable<string> VariablesUsedForPrediction { get { return Enumerable.Empty<string>(); } } 36 37 [Storable] 38 private readonly string targetVariable; 39 public string TargetVariable { 40 get { return targetVariable; } 41 } 42 35 43 [Storable] 36 44 private double constant; … … 45 53 : base(original, cloner) { 46 54 this.constant = original.constant; 55 this.targetVariable = original.targetVariable; 47 56 } 57 48 58 public override IDeepCloneable Clone(Cloner cloner) { return new ConstantRegressionModel(this, cloner); } 49 59 50 public ConstantRegressionModel(double constant )60 public ConstantRegressionModel(double constant, string targetVariable = "Target") 51 61 : base() { 52 62 this.name = ItemName; … … 54 64 this.constant = constant; 55 65 this.ReadOnly = true; // changing a constant regression model is not supported 66 this.targetVariable = targetVariable; 56 67 } 57 68 -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs
r13715 r13921 34 34 [Item("RegressionEnsembleModel", "A regression model that contains an ensemble of multiple regression models")] 35 35 public sealed class RegressionEnsembleModel : NamedItem, IRegressionEnsembleModel { 36 public IEnumerable<string> VariablesUsedForPrediction { 37 get { return models.SelectMany(x => x.VariablesUsedForPrediction).Distinct().OrderBy(x => x); } 38 } 36 39 37 40 private List<IRegressionModel> models; 38 41 public IEnumerable<IRegressionModel> Models { 39 42 get { return new List<IRegressionModel>(models); } 43 } 44 45 [Storable] 46 private readonly string target; 47 public string TargetVariable { 48 get { return models.First().TargetVariable; } 40 49 } 41 50
Note: See TracChangeset
for help on using the changeset viewer.