Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/15 19:48:17 (8 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
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  
    172172    <Compile Include="Implementation\Classification\ConstantClassificationSolution.cs" />
    173173    <Compile Include="Implementation\Classification\DiscriminantFunctionClassificationSolutionBase.cs" />
    174     <Compile Include="Implementation\Classification\ConstantClassificationModel.cs" />
    175174    <Compile Include="Implementation\Clustering\ClusteringProblem.cs" />
    176175    <Compile Include="Implementation\Clustering\ClusteringProblemData.cs" />
  • branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ConstantClassificationSolution.cs

    r9119 r13089  
    2828  [Item(Name = "Constant Classification Solution", Description = "Represents a constant classification solution (model + data).")]
    2929  public class ConstantClassificationSolution : ClassificationSolution {
    30     public new ConstantClassificationModel Model {
    31       get { return (ConstantClassificationModel)base.Model; }
     30    public new ConstantRegressionModel Model {
     31      get { return (ConstantRegressionModel)base.Model; }
    3232      set { base.Model = value; }
    3333    }
     
    3636    protected ConstantClassificationSolution(bool deserializing) : base(deserializing) { }
    3737    protected ConstantClassificationSolution(ConstantClassificationSolution original, Cloner cloner) : base(original, cloner) { }
    38     public ConstantClassificationSolution(ConstantClassificationModel model, IClassificationProblemData problemData)
     38    public ConstantClassificationSolution(ConstantRegressionModel model, IClassificationProblemData problemData)
    3939      : base(model, problemData) {
    4040      RecalculateResults();
  • 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.