Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/05/12 10:26:22 (12 years ago)
Author:
mkommend
Message:

#1928: Corrected bug in AccuracyMaximizationThresholdCalculator regarding multi-class classification.

File:
1 edited

Legend:

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

    r8554 r8573  
    9494              //all negatives
    9595            else {
     96              //false positive
    9697              if (pair.EstimatedValue > lowerThreshold && pair.EstimatedValue <= actualThreshold)
    97                 //false positive
    9898                classificationScore += problemData.GetClassificationPenalty(pair.TargetClassValue, classValues[i - 1]);
    99               else
    100                 //true negative, consider only upper class
    101                 classificationScore += problemData.GetClassificationPenalty(pair.TargetClassValue, pair.TargetClassValue);
     99              else if (pair.EstimatedValue <= lowerThreshold)
     100                classificationScore += problemData.GetClassificationPenalty(pair.TargetClassValue, classValues[i - 2]);
     101              else if (pair.EstimatedValue > actualThreshold) {
     102                if (pair.TargetClassValue < classValues[i - 1]) //negative in wrong class, consider upper class
     103                  classificationScore += problemData.GetClassificationPenalty(pair.TargetClassValue, classValues[i]);
     104                else //true negative, must be optimized by the other thresholds
     105                  classificationScore += problemData.GetClassificationPenalty(pair.TargetClassValue, pair.TargetClassValue);
     106              }
    102107            }
    103108          }
Note: See TracChangeset for help on using the changeset viewer.