Cost-sensitive multi-class classification from probability estimates

Deirdre B. O'Brien, Maya R. Gupta, Robert M. GrayICML 2008

In many real-world classification tasks, accuracy alone is an insufficient metric. Different types of mistakes often carry vastly different consequences—for instance, missing a rare but fatal disease is far more costly than a false alarm. While the machine learning community has well-established tools like Receiver Operating Characteristic (ROC) curves to handle cost-sensitive decisions in binary classification, extending this logic to multi-class problems is significantly more complex.

This paper introduces a post-processing method to improve multi-class classification when dealing with unequal misclassification costs. By treating the decision boundaries on the probability simplex as adjustable parameters, the authors demonstrate how to correct for the systematic biases inherent in common algorithms like Naive Bayes and Quadratic Discriminant Analysis (QDA).

The Problem: Biased Probability Estimates

Standard cost-sensitive classifiers typically operate in two steps: first, they estimate the probability of each class for a given instance; second, they select the class that minimizes the expected cost based on those probabilities.

However, a major flaw in this approach is that most standard classifiers produce biased probability estimates.

Examples of biased probability estimates on the simplex for Naive Bayes and k-NN.

As illustrated above, different algorithms distort probabilities in different ways. Naive Bayes often "undersmooths," pushing probability estimates toward the extremes (becoming overconfident). Conversely, algorithms like k-Nearest Neighbors (k-NN) tend to "oversmooth," pushing estimates toward the center or average. When these warped estimates are plugged directly into a cost-sensitive decision rule, the resulting classification boundaries are suboptimal, leading to higher actual costs.

Proposed Method: Parallel Partitioning

The authors propose a geometric solution: if systematic errors warp the probability estimates on the simplex (a triangle for 3 classes, a tetrahedron for 4, etc.), we can "warp" the decision boundaries to compensate.

1. Geometric Analysis and Parallel Shifts

Instead of relying on the "true" cost matrix to draw decision boundaries, the authors propose learning a new "partition matrix" that minimizes the actual empirical cost on a validation set.

Through geometric analysis, they establish how changes to a cost matrix affect these boundaries. Crucially, they prove that adding a constant to a row of the cost matrix results in a parallel shift of the decision boundaries on the simplex.

Visualizing different boundary transformations, highlighting the proposed parallel shifts.

2. Regularization via Parallelism

A full, unconstrained cost matrix for $K$ classes has $K^2 - K$ parameters. Tuning all of these on a validation set would almost certainly lead to overfitting. To prevent this, the authors restrict their search to partition matrices that only shift boundaries in a parallel fashion. This constraint acts as a powerful regularizer, reducing the problem to learning just $K$ parameters (one per class) while still providing enough flexibility to fix systematic bias.

3. Optimization via Changepoints

To find the optimal $K$ parameters, the authors employ a greedy search algorithm. For each class, they identify "changepoints"—specific parameter values where a small shift would cause a training sample to cross a boundary and switch its predicted class. The algorithm evaluates these changepoints and selects the values that minimize the total cost.

Experimental Results

The authors evaluated their "Parallel Partitioning" method across 21 multi-class datasets from the UCI Machine Learning Repository, using both discrete and continuous feature sets. They tested the method using Multinomial Naive Bayes and Regularized QDA as base classifiers, comparing it against MetaCost (a popular bagging-based approach) and the LF method (which scales probabilities by class weights).

  • Rarity-Based Costs: In scenarios where misclassifying rare classes incurs a higher penalty, the Parallel method achieved a 10.8% mean improvement over the baseline. MetaCost and the LF method actually degraded performance on average (-7.2% and -2.1%, respectively).
  • Random Costs: When tested with randomly generated cost matrices, the Parallel method secured an 8.9% mean improvement, again outperforming the baselines.
  • Robustness: The Parallel method proved highly stable. In contrast, the LF method occasionally caused massive spikes in error (exceeding 100% degradation in some edge cases).

Because the method is designed to combat systematic error (bias) rather than random noise (variance), it proved most effective on larger datasets where model bias is the primary bottleneck.

Limitations and Future Directions

While highly effective for many scenarios, the authors note a few limitations:

  • Small Datasets: On very small datasets (e.g., Iris or Dermatology), the method is prone to overfitting the validation set, yielding little to no improvement.
  • Optimization Constraints: The greedy search strategy may settle for local optima. More sophisticated global optimization techniques could potentially unlock even better boundary placements.
  • Computational Overhead: Although restricting the search to parallel shifts is mathematically efficient, the greedy search still requires iterating through changepoints for every sample in the validation set, which could become a bottleneck for extremely large-scale datasets.

Summary updated

BibTeX
@inproceedings{obrien2008cost,
  author = {Deirdre B. O'Brien and Maya R. Gupta and Robert M. Gray},
  title = {{Cost-sensitive multi-class classification from probability estimates}},
  booktitle = {International Conference on Machine Learning},
  year = {2008},
  doi = {10.1145/1390156.1390246},
}
Figure