Free cookie consent management tool by TermsFeed Policy Generator

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

#1998:

  • changed namespace and name of view
  • calculate f1 score only for solutions for binary classification problems
File:
1 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);
Note: See TracChangeset for help on using the changeset viewer.