Changeset 15280 for branches/Async/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs
- Timestamp:
- 07/23/17 00:52:14 (7 years ago)
- Location:
- branches/Async
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async
- Property svn:mergeinfo changed
-
branches/Async/HeuristicLab.Problems.DataAnalysis
-
branches/Async/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs
r13100 r15280 32 32 [Item("Constant Regression Model", "A model that always returns the same constant value regardless of the presented input data.")] 33 33 [Obsolete] 34 public class ConstantRegressionModel : NamedItem, IRegressionModel, IStringConvertibleValue { 34 public class ConstantRegressionModel : RegressionModel, IStringConvertibleValue { 35 public override IEnumerable<string> VariablesUsedForPrediction { get { return Enumerable.Empty<string>(); } } 36 35 37 [Storable] 36 38 private double constant; … … 46 48 this.constant = original.constant; 47 49 } 50 48 51 public override IDeepCloneable Clone(Cloner cloner) { return new ConstantRegressionModel(this, cloner); } 49 52 50 public ConstantRegressionModel(double constant )51 : base( ) {53 public ConstantRegressionModel(double constant, string targetVariable) 54 : base(targetVariable) { 52 55 this.name = ItemName; 53 56 this.description = ItemDescription; … … 56 59 } 57 60 58 public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) {61 public override IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) { 59 62 return rows.Select(row => Constant); 60 63 } 61 64 62 public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {63 return new ConstantRegressionSolution(new ConstantModel(constant ), new RegressionProblemData(problemData));65 public override IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) { 66 return new ConstantRegressionSolution(new ConstantModel(constant, TargetVariable), new RegressionProblemData(problemData)); 64 67 } 65 68
Note: See TracChangeset
for help on using the changeset viewer.