Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13097


Ignore:
Timestamp:
11/02/15 21:39:09 (9 years ago)
Author:
gkronber
Message:

#1998: reverse merge of r13089 (reused the ConstantRegressionModel as ConstantClassificationModel (OK?))

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs

    r13089 r13097  
    3030namespace HeuristicLab.Problems.DataAnalysis {
    3131  [StorableClass]
    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 {
     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 {
    3534    [Storable]
    3635    private double constant;
     
    6059    }
    6160
    62     public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {
    63       return GetEstimatedValues(dataset, rows);
    64     }
    65 
    6661    public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {
    6762      return new ConstantRegressionSolution(this, new RegressionProblemData(problemData));
    68     }
    69 
    70     public IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) {
    71       return new ConstantClassificationSolution(this, new ClassificationProblemData(problemData));
    7263    }
    7364
     
    7970    public bool ReadOnly { get; private set; }
    8071    public bool Validate(string value, out string errorMessage) {
    81       throw new NotSupportedException(); // changing a constant model is not supported
     72      throw new NotSupportedException(); // changing a constant regression model is not supported
    8273    }
    8374
     
    8778
    8879    public bool SetValue(string value) {
    89       throw new NotSupportedException(); // changing a constant model is not supported
     80      throw new NotSupportedException(); // changing a constant regression model is not supported
    9081    }
    9182
    9283    public event EventHandler ValueChanged;
    9384    #endregion
    94 
    9585  }
    9686}
Note: See TracChangeset for help on using the changeset viewer.