On reoptimizing multi-class classifiers

Chris Bourke, Kun Deng, Stephen D. Scott, Robert E. Schapire, N. V. Vinodchandran

Introduction

In real-world machine learning applications, the environment is rarely static. A classifier trained to minimize error on historical data may become suboptimal if the costs associated with specific errors change or if the class distribution shifts. For binary classifiers, the relationship between different operating points is well-understood through Receiver Operating Characteristic (ROC) curves, which allow practitioners to select an optimal threshold without retraining the model.

However, extending this to multi-class problems is significantly more complex. As the number of classes increases, the simple ROC curve expands into a high-dimensional "hypersurface." This paper investigates the theoretical complexity of finding the optimal operating point for multi-class classifiers under new cost matrices and introduces MetaClass, a novel heuristic designed to navigate this complexity efficiently.

Theoretical Complexity: The REWEIGHT Problem

The authors first address the fundamental question of whether an efficient algorithm exists for reoptimizing multi-class models. They define the REWEIGHT problem: given a set of class probabilities for $m$ examples and a cost matrix, find the weight vector that minimizes the total expected cost.

Through a reduction from the MINSAT problem, the authors prove that the decision version of REWEIGHT is NP-complete. This finding is significant as it establishes that a universal, polynomial-time algorithm for finding the absolute optimal weights is unlikely to exist as the number of classes ($n$) grows. While they demonstrate that the problem is solvable in polynomial time relative to the number of examples ($m$) if $n$ is fixed and small, this approach quickly becomes computationally intractable for large-scale multi-class problems.

The MetaClass Heuristic

To address the computational bottleneck, the authors propose MetaClass, a fast, greedy heuristic. MetaClass employs a top-down, recursive partitioning strategy:

  1. Metaclass Partitioning: The algorithm treats groups of classes as "metaclasses."
  2. Recursive Splitting: It builds a decision tree where each internal node determines an optimal threshold between two sets of classes.
  3. Efficiency: By using a greedy approach, MetaClass achieves a computational complexity of $O(m \log m \log n)$. This is a significant improvement over previous state-of-the-art heuristics like the LF algorithm, which scales linearly with $n$ rather than logarithmically.

MetaClass produces a decision tree of weights, which the authors argue provides a more expressive hypothesis class than a single linear weight vector. This structure allows the model to capture complex relationships between classes that linear re-weighting might miss.

Experimental Methodology

The researchers evaluated MetaClass against several alternative strategies:

  • LF: A bottom-up hill-climbing approach.
  • Genetic Algorithms (GA): Two variants—one optimizing a probabilistic model (GA1) and one directly optimizing the cost function (GA2).
  • Mathematical Programming: Relaxed Integer Linear Programming (LP) and Quadratic Programming (QP) formulations.

Testing was conducted using 24 datasets from the UCI Machine Learning Repository (e.g., Audiology, Car, Mushroom). Weka’s Naïve Bayes served as the base classifier. The models were tested under both uniform costs (standard accuracy) and non-uniform costs, where cost matrices were assigned randomly to simulate varying real-world priorities.

Key Results and Insights

Optimization and Generalization

In nearly every dataset, MetaClass, LF, and the direct Genetic Algorithm (GA2) significantly outperformed the baseline Naïve Bayes model. Interestingly, the "greedy" local decisions made by MetaClass and LF were often as effective as, or superior to, global optimization tools like GA or Quadratic Programming.

Furthermore, MetaClass demonstrated excellent generalization. While complex mathematical programming models sometimes overfit the training data, the weights discovered by MetaClass remained robust when applied to unseen test data. In non-uniform cost scenarios, MetaClass statistically outperformed the LF algorithm, establishing it as a new benchmark for multi-class reoptimization.

Computational Performance

The disparity in computational load was stark. While Genetic Algorithms required several minutes and hundreds of generations to converge, MetaClass and LF executed in seconds. The logarithmic scaling of MetaClass makes it particularly suitable for high-dimensional problems where other methods become prohibitive.

Conclusion and Future Work

This research establishes that while multi-class reoptimization is theoretically "hard" (NP-complete), practical and efficient solutions are possible through recursive heuristics. MetaClass provides a scalable, expressive, and robust method for adjusting classifiers to new cost environments without the need for expensive retraining.

Future research directions include testing these strategies on more sophisticated base learners, such as Support Vector Machines (SVMs), and investigating how these heuristics perform under "extreme skews" in cost matrices (e.g., where one error is orders of magnitude more costly than others). Additionally, the lack of formal PAC (Probably Approximately Correct) generalization guarantees for MetaClass remains an open challenge for theoretical researchers.

Summary updated

Abstract

Significant changes in the instance distribution or associated cost function of a learning problem require one to reoptimize a previously-learned classifier to work under new conditions. We study the problem of reoptimizing a multi-class classifier based on its ROC hypersurface and a matrix describing the costs of each type of prediction error. For a binary classifier, it is straightforward to find an optimal operating point based on its ROC curve and the relative cost of true positive to false positive error. However, the corresponding multi-class problem (finding an optimal operating point based on a ROC hypersurface and cost matrix) is more challenging and until now, it was unknown whether an efficient algorithm existed that found an optimal solution. We answer this question by first proving that the decision version of this problem is \(\mathsf{NP}\) -complete. As a complementary positive result, we give an algorithm that finds an optimal solution in polynomial time if the number of classes n is a constant. We also present several heuristics for this problem, including linear, nonlinear, and quadratic programming formulations, genetic algorithms, and a customized algorithm. Empirical results suggest that under both uniform and non-uniform cost models, simple greedy methods outperform more sophisticated methods.
BibTeX
@article{bourke2008reoptimizing,
  author = {Chris Bourke and Kun Deng and Stephen D. Scott and Robert E. Schapire and N. V. Vinodchandran},
  title = {{On reoptimizing multi-class classifiers}},
  journal = {Machine Learning},
  year = {2008},
  doi = {10.1007/s10994-008-5056-8},
}
Figure