- Timestamp:
- 10/29/15 19:48:17 (8 years ago)
- Location:
- branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r13083 r13089 172 172 <Compile Include="Implementation\Classification\ConstantClassificationSolution.cs" /> 173 173 <Compile Include="Implementation\Classification\DiscriminantFunctionClassificationSolutionBase.cs" /> 174 <Compile Include="Implementation\Classification\ConstantClassificationModel.cs" />175 174 <Compile Include="Implementation\Clustering\ClusteringProblem.cs" /> 176 175 <Compile Include="Implementation\Clustering\ClusteringProblemData.cs" /> -
branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ConstantClassificationSolution.cs
r9119 r13089 28 28 [Item(Name = "Constant Classification Solution", Description = "Represents a constant classification solution (model + data).")] 29 29 public class ConstantClassificationSolution : ClassificationSolution { 30 public new Constant ClassificationModel Model {31 get { return (Constant ClassificationModel)base.Model; }30 public new ConstantRegressionModel Model { 31 get { return (ConstantRegressionModel)base.Model; } 32 32 set { base.Model = value; } 33 33 } … … 36 36 protected ConstantClassificationSolution(bool deserializing) : base(deserializing) { } 37 37 protected ConstantClassificationSolution(ConstantClassificationSolution original, Cloner cloner) : base(original, cloner) { } 38 public ConstantClassificationSolution(Constant ClassificationModel model, IClassificationProblemData problemData)38 public ConstantClassificationSolution(ConstantRegressionModel model, IClassificationProblemData problemData) 39 39 : base(model, problemData) { 40 40 RecalculateResults(); -
branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs
r13083 r13089 30 30 namespace HeuristicLab.Problems.DataAnalysis { 31 31 [StorableClass] 32 [Item("Constant Regression Model", "A model that always returns the same constant value regardless of the presented input data.")] 33 public class ConstantRegressionModel : NamedItem, IRegressionModel, IStringConvertibleValue { 32 [Item("Constant Model", "A model that always returns the same constant value regardless of the presented input data.")] 33 // TODO this class should be renamed, since it is also used to handle the classification case now 34 public class ConstantRegressionModel : NamedItem, IRegressionModel, IClassificationModel, IStringConvertibleValue { 34 35 [Storable] 35 36 private double constant; … … 59 60 } 60 61 62 public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) { 63 return GetEstimatedValues(dataset, rows); 64 } 65 61 66 public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) { 62 67 return new ConstantRegressionSolution(this, new RegressionProblemData(problemData)); 68 } 69 70 public IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 71 return new ConstantClassificationSolution(this, new ClassificationProblemData(problemData)); 63 72 } 64 73 … … 70 79 public bool ReadOnly { get; private set; } 71 80 public bool Validate(string value, out string errorMessage) { 72 throw new NotSupportedException(); // changing a constant regressionmodel is not supported81 throw new NotSupportedException(); // changing a constant model is not supported 73 82 } 74 83 … … 78 87 79 88 public bool SetValue(string value) { 80 throw new NotSupportedException(); // changing a constant regressionmodel is not supported89 throw new NotSupportedException(); // changing a constant model is not supported 81 90 } 82 91 83 92 public event EventHandler ValueChanged; 84 93 #endregion 94 85 95 } 86 96 }
Note: See TracChangeset
for help on using the changeset viewer.