Ignore:
Timestamp:
11/03/15 06:51:49 (7 years ago)
Author:
gkronber
Message:

#1998:

  • changed namespace and name of view
  • calculate f1 score only for solutions for binary classification problems
Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionBase.cs

    r13100 r13102  
    137137        ClassificationPerformanceMeasures.SetTestResults(testPerformanceCalculator);
    138138
    139       var f1Training = FOneScoreCalculator.Calculate(originalTrainingClassValues, estimatedTrainingClassValues, out errorState);
    140       if (errorState == OnlineCalculatorError.None) ClassificationPerformanceMeasures.TrainingF1Score = f1Training;
    141       var f1Test = FOneScoreCalculator.Calculate(originalTestClassValues, estimatedTestClassValues, out errorState);
    142       if (errorState == OnlineCalculatorError.None) ClassificationPerformanceMeasures.TestF1Score = f1Test;
    143 
     139      if (ProblemData.Classes == 2) {
     140        var f1Training = FOneScoreCalculator.Calculate(originalTrainingClassValues, estimatedTrainingClassValues, out errorState);
     141        if (errorState == OnlineCalculatorError.None) ClassificationPerformanceMeasures.TrainingF1Score = f1Training;
     142        var f1Test = FOneScoreCalculator.Calculate(originalTestClassValues, estimatedTestClassValues, out errorState);
     143        if (errorState == OnlineCalculatorError.None) ClassificationPerformanceMeasures.TestF1Score = f1Test;
     144      }
    144145
    145146      var mccTraining = MatthewsCorrelationCoefficientCalculator.Calculate(originalTrainingClassValues, estimatedTrainingClassValues, out errorState);
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/ClassificationPerformanceMeasuresCalculator.cs

    r12012 r13102  
    2323using System.Collections.Generic;
    2424using HeuristicLab.Common;
     25using HeuristicLab.Problems.DataAnalysis.OnlineCalculators;
    2526
    2627namespace HeuristicLab.Problems.DataAnalysis {
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/ConfusionMatrixCalculator.cs

    r13100 r13102  
    2424using System.Linq;
    2525
    26 namespace HeuristicLab.Problems.DataAnalysis.OnlineCalculators {
     26namespace HeuristicLab.Problems.DataAnalysis {
    2727  public class ConfusionMatrixCalculator {
    2828    public static double[,] Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/FOneScoreCalculator.cs

    r13100 r13102  
    2424using System.Linq;
    2525
    26 namespace HeuristicLab.Problems.DataAnalysis.OnlineCalculators {
     26namespace HeuristicLab.Problems.DataAnalysis {
    2727  public class FOneScoreCalculator {
    2828    public static double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
Note: See TracChangeset for help on using the changeset viewer.