Changeset 13091


Ignore:
Timestamp:
10/29/15 20:39:11 (4 years ago)
Author:
gkronber
Message:

#1998: minor changes

Location:
branches/ClassificationModelComparison
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/BaselineClassifiers/ZeroR.cs

    r13090 r13091  
    3131  /// 0R classification algorithm.
    3232  /// </summary>
    33   [Item("ZeroR", "The simplest possible classifier, ZeroR always predicts the majority class.")]
     33  [Item("ZeroR Classification", "The simplest possible classifier, ZeroR always predicts the majority class.")]
    3434  [Creatable("Data Analysis")] // TODO
    3535  [StorableClass]
  • branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionComparisonView.cs

    r13089 r13091  
    132132      zeroR.Name = "ZeroR Classification Solution";
    133133      newSolutions.Add(zeroR);
    134       var oneR = OneRTest.CreateOneRSolution(problemData);
     134      var oneR = OneR.CreateOneRSolution(problemData);
    135135      oneR.Name = "OneR Classification Solution";
    136136      newSolutions.Add(oneR);
  • branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/ConfusionMatrixCalculator.cs

    r9119 r13091  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3131      }
    3232
    33       IEnumerable<double> classValues = originalValues.Distinct();
    34       IEnumerable<double> estimatedClassValues = estimatedValues.Distinct();
     33      var  classValues = originalValues.Distinct().ToList();
     34      var estimatedClassValues = estimatedValues.Distinct().ToList();
    3535
    36       if (!estimatedClassValues.All(x => originalValues.Contains(x))) {
     36      if (!estimatedClassValues.All(x => classValues.Contains(x))) {
    3737        errorState = OnlineCalculatorError.InvalidValueAdded;
    3838        return null;
    3939      }
    4040
    41       int classes = classValues.Count();
     41      int classes = classValues.Count;
    4242      double[,] confusionMatrix = new double[classes, classes];
    4343
  • branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/FOneScoreCalculator.cs

    r9119 r13091  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2727  public class FOneScoreCalculator {
    2828    public static double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
    29       if (originalValues.Distinct().Count() != 2) {
     29      if (originalValues.Distinct().Skip(2).Any()) {
    3030        throw new ArgumentException("F1 score can only be calculated for binary classification.");
    3131      }
     
    4040    private static double CalculateFOne(double[,] confusionMatrix) {
    4141      double precision = confusionMatrix[0, 0] / (confusionMatrix[0, 0] + confusionMatrix[0, 1]);
    42 
    4342      double recall = confusionMatrix[0, 0] / (confusionMatrix[0, 0] + confusionMatrix[1, 0]);
    4443
  • branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/MatthewsCorrelationCoefficientCalculator.cs

    r9119 r13091  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
Note: See TracChangeset for help on using the changeset viewer.