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.Algorithms.DataAnalysis/3.4
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj

    r13085 r13089  
    318318    <Compile Include="Linear\AlglibUtil.cs" />
    319319    <Compile Include="Linear\OneRTest.cs" />
    320     <Compile Include="Linear\OneR.cs" />
    321320    <Compile Include="Linear\OneR\OneRClassificationModel.cs" />
    322321    <Compile Include="Linear\OneR\OneRClassificationSolution.cs" />
  • branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneRTest.cs

    r10570 r13089  
    3434  /// 1R classification algorithm.
    3535  /// </summary>
    36   [Item("OneR Classification", "1R classification algorithm.")]
     36  [Item("OneR Classification", "A simple classification algorithm the searches the best single-variable split (does not support categorical features correctly).")]
    3737  [StorableClass]
    3838  public sealed class OneRTest : FixedDataAnalysisAlgorithm<IClassificationProblem> {
     
    6363    }
    6464
    65     public static IClassificationSolution CreateOneRSolution(IClassificationProblemData problemData, int minBucketSize) {
     65    public static IClassificationSolution CreateOneRSolution(IClassificationProblemData problemData, int minBucketSize = 6) {
    6666      var bestClassified = 0;
    6767      List<Split> bestSplits = null;
  • branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/ZeroR.cs

    r13086 r13089  
    3131  /// 0R classification algorithm.
    3232  /// </summary>
    33   [Item("ZeroR", "0R classification algorithm.")]
    34   [Creatable("Data Analysis")]
     33  [Item("ZeroR", "The simplest possible classifier, ZeroR always predicts the majority class.")]
     34  [Creatable("Data Analysis")] // TODO
    3535  [StorableClass]
    3636  public sealed class ZeroR : FixedDataAnalysisAlgorithm<IClassificationProblem> {
     
    5252    protected override void Run() {
    5353      var solution = CreateZeroRSolution(Problem.ProblemData);
    54       Results.Add(new Result("ZeroR solution", "The 0R classifier.", solution));
     54      Results.Add(new Result("ZeroR solution", "The simplest possible classifier, ZeroR always predicts the majority class.", solution));
    5555    }
    5656
     
    6060      var targetValues = dataset.GetDoubleValues(target, problemData.TrainingIndices);
    6161
     62
     63      // if multiple classes have the same number of observations then simply take the first one
    6264      var dominantClass = targetValues.GroupBy(x => x).ToDictionary(g => g.Key, g => g.Count())
    6365        .MaxItems(kvp => kvp.Value).Select(x => x.Key).First();
    6466
    65       var model = new ConstantClassificationModel(dominantClass);
     67      var model = new ConstantRegressionModel(dominantClass);
    6668      var solution = new ConstantClassificationSolution(model, (IClassificationProblemData)problemData.Clone());
    6769      return solution;
Note: See TracChangeset for help on using the changeset viewer.