Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/15 19:48:17 (9 years ago)
Author:
gkronber
Message:

#1998

  • deleted obsolete version of OneR algorithm (also does perform worse than mkommend's implementation in my tests)
  • reused the ConstantRegressionModel as ConstantClassificationModel (OK?)
  • fixed a few strings here and there
File:
1 edited

Legend:

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

    r13083 r13089  
    3030namespace HeuristicLab.Problems.DataAnalysis {
    3131  [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 {
    3435    [Storable]
    3536    private double constant;
     
    5960    }
    6061
     62    public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {
     63      return GetEstimatedValues(dataset, rows);
     64    }
     65
    6166    public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {
    6267      return new ConstantRegressionSolution(this, new RegressionProblemData(problemData));
     68    }
     69
     70    public IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) {
     71      return new ConstantClassificationSolution(this, new ClassificationProblemData(problemData));
    6372    }
    6473
     
    7079    public bool ReadOnly { get; private set; }
    7180    public bool Validate(string value, out string errorMessage) {
    72       throw new NotSupportedException(); // changing a constant regression model is not supported
     81      throw new NotSupportedException(); // changing a constant model is not supported
    7382    }
    7483
     
    7887
    7988    public bool SetValue(string value) {
    80       throw new NotSupportedException(); // changing a constant regression model is not supported
     89      throw new NotSupportedException(); // changing a constant model is not supported
    8190    }
    8291
    8392    public event EventHandler ValueChanged;
    8493    #endregion
     94
    8595  }
    8696}
Note: See TracChangeset for help on using the changeset viewer.