Changeset 13948 for branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs
- Timestamp:
- 06/29/16 10:36:52 (8 years ago)
- Location:
- branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis merged: 13921,13938,13941
- Property svn:mergeinfo changed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs
r13100 r13948 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 = "Target") 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) {65 public override IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) { 63 66 return new ConstantRegressionSolution(new ConstantModel(constant), new RegressionProblemData(problemData)); 64 67 }
Note: See TracChangeset
for help on using the changeset viewer.