úterý 31. července 2018

Disadvantages of AUC and the fixes

Area Under the Curve for Receiver Operating Characteristics (further referred as AUC) is a nice measure, but of course, it has some potential theoretical disadvantages:

  1. It takes into account all possible decision thresholds.
  2. It assumes uniform misclassification cost.
  3. It does not measure calibration of the predictions.

Consequences:
  1. We are generally interested into decision thresholds close to the true ratio of positive samples to negative samples. For example, whenever we have an extreme class ratio, like in information retrieval where we have only a few positive samples but many negative samples, we are much more likely to be interested into observing the few predicted positives than into observing a few almost certain negatives (or complementary, to seeing all but a few almost certain negatives), simply because positives are rare while there is an abundance of negative samples (if you randomly pick a few samples, you are almost guaranteed that they all will be negative). But AUC puts equal weight to all thresholds. Consequently, in the case of severe class imbalance, it is easy to find examples, where higher AUC corresponds to worse performance in the real world - a model with modest AUC but stellar performance in the working region can beat a model that has an awesome AUC but underperforms in the working region.
  2. The sum of the cost of all positives samples is generally similar to the sum of the cost of all negative samples. In the case of severe class imbalance, we generally put much more weight on the rare class samples than on the common samples. I.e.: it is more important for us that a positive sample is classified as positive than when a negative sample is classified as negative. However, AUC puts equal weight on both classes. Consequently, if we can correctly predict a large portion of negative samples as negative (as is common in information retrieval), it is easy to get AUC close to 1.0 as demonstrated in this example
  3. Whenever we need calibrated probabilities as the output of a classifier (for example for risk assessment), AUC is not really informative. But in defense of AUC, if the business application asks for ranking and not for calibrated probabilities, we want to optimize ranking and not the quality of calibration because we can come with two models: one with great ranking but terrible calibration (e.g.: because all the probabilities are squeezed to the decision boundary like in SVM) and another model with great calibration but terrible ranking (e.g.: decision trees create plateaus of probabilities that hurt their ranking scores). 

Practical complications:
  1. When AUC was defined, it was not said how to handle ties. Consequently, everyone implements it differently and the reported values differ.
  2. It was (originally) defined only for binary classification. Consequently, there are multiple non-comparable proposals for extension into multiclass situations.
  3. All ranking measures that take into consideration all the predictions (like AUC does) are slow when you have a lot of samples (> 10M). 
Solutions for the mentioned issues (in the order of their appearance):
  1. Use AUC with Beta prior on the threshold location: H measure
  2. Use sample-weighted AUC 
  3. Use Brier score
  4. Test the implementation against reasonably looking unit-tests . A fast and concise implementation that passes the tests is at MATLAB Central
  5. Use M measure
  6. Both, thresholding and calibration measures scale linearly with the count of samples. Use them. Alternatively, you may calculate a ranking measure on a specific subset of data. An example is NDCG@k, which you may get in O(n + k log k) time, where k is the top k samples and n is the count of samples.

Žádné komentáře:

Okomentovat