Changeset 16692 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/ConstantModel.cs
- Timestamp:
- 03/18/19 17:24:30 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/ConstantModel.cs
r13154 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 31 31 [StorableClass] 32 32 [Item("Constant Model", "A model that always returns the same constant value regardless of the presented input data.")] 33 public class ConstantModel : NamedItem, IRegressionModel, IClassificationModel, ITimeSeriesPrognosisModel, IStringConvertibleValue { 33 public class ConstantModel : RegressionModel, IClassificationModel, ITimeSeriesPrognosisModel, IStringConvertibleValue { 34 public override IEnumerable<string> VariablesUsedForPrediction { get { return Enumerable.Empty<string>(); } } 35 36 34 37 [Storable] 35 private double constant;38 private readonly double constant; 36 39 public double Constant { 37 40 get { return constant; } … … 45 48 this.constant = original.constant; 46 49 } 50 47 51 public override IDeepCloneable Clone(Cloner cloner) { return new ConstantModel(this, cloner); } 48 52 49 public ConstantModel(double constant )50 : base( ) {53 public ConstantModel(double constant, string targetVariable) 54 : base(targetVariable) { 51 55 this.name = ItemName; 52 56 this.description = ItemDescription; … … 55 59 } 56 60 57 public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) {61 public override IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) { 58 62 return rows.Select(row => Constant); 59 63 } … … 65 69 } 66 70 67 public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {71 public override IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) { 68 72 return new ConstantRegressionSolution(this, new RegressionProblemData(problemData)); 69 73 } … … 93 97 } 94 98 99 #pragma warning disable 0067 95 100 public event EventHandler ValueChanged; 101 #pragma warning restore 0067 96 102 #endregion 97 103
Note: See TracChangeset
for help on using the changeset viewer.