Online Classification with Complex Metrics

Bowei Yan, Oluwasanmi Koyejo, Kai Zhong, Pradeep RavikumararXiv 2016

TL;DR

This paper introduces a novel framework for binary classification that optimizes complex, non-decomposable performance metrics (like F-measure and Jaccard index), which are often challenging for standard methods. They propose efficient batch and online algorithms that achieve competitive performance with significantly reduced computational cost, especially for large datasets.

What Problem Does This Paper Address?

Many real-world classification tasks, particularly those with imbalanced classes (e.g., medical diagnosis, information retrieval), require optimizing performance metrics beyond simple accuracy. Metrics like the F-measure or Jaccard index are "non-decomposable," meaning they can't be directly optimized by standard techniques that rely on summing up individual sample losses. This makes it difficult to design efficient algorithms, especially for online learning scenarios where data arrives sequentially. Existing methods often struggle with scalability, theoretical guarantees, or are limited to specific types of metrics or linear models.

Methods

The core idea is to leverage a key insight: the Bayes optimal classifier for many complex metrics can be expressed as a simple thresholding of the conditional probability of the positive class. The paper's contributions are:

  • Characterization of Optimal Threshold: They formally show that for a broad family of monotonic metrics, the optimal threshold has a specific parametric form, extending previous work.
  • Normalized Gradient Descent (NGD): They propose an NGD algorithm to efficiently estimate this optimal threshold. This method is designed to handle the "plateaus and sharp cliffs" that can arise in the utility function, making it robust.
  • Batch Algorithm: A two-step approach: first, estimate the conditional probability (using any standard method like logistic regression), then use NGD to find the optimal threshold.
  • Online Algorithm (OCMO): An extension of the batch method for streaming data. It updates the conditional probability estimate online and uses NGD for threshold optimization in an inner loop. This allows processing data in a single pass.

Datasets

The paper uses several publicly available datasets for evaluation:

  • DEFAULT: A dataset for credit card default prediction.
  • NEWS20: A dataset related to news categorization.
  • RCV1: Reuters Corpus Volume 1, a large text classification dataset.
  • EPSILON: A dataset from the UCI Machine Learning Repository.
  • KDDA & KDDB: Two datasets related to KDD Cup.

The paper also mentions synthetic experiments generated from multivariate Gaussian distributions with logistic models.

Key Insights and Ideas

  • Thresholding is Key: The fundamental insight is that complex metric optimization boils down to finding the right threshold for the predicted probability. This simplifies the problem significantly.
  • Local Quasi-Concavity is Sufficient: Even though the utility function isn't globally concave, they prove it's strictly locally quasi-concave with respect to the threshold. This property is crucial for the convergence of their gradient-based methods.
  • NGD for Robustness: Normalized Gradient Descent is a clever way to handle the non-smoothness and potential flatness of the utility function, ensuring convergence even when standard gradient descent might fail.
  • Generality: The framework is designed to be general, working with various conditional probability estimators (linear or non-linear) and a wide range of performance metrics.

Key Results

  • Performance: The proposed algorithms (both batch and online) achieve comparable or better prediction performance than existing methods on various metrics (F1, Q-Mean, H-Mean) and datasets.
  • Computational Efficiency: The batch algorithm offers significant speedups over exhaustive search methods, especially for larger datasets. The online algorithm is particularly efficient, processing data in a single pass and outperforming other online methods in terms of speed and performance. For example, Table 2 shows that the second step of their batch algorithm (threshold optimization) is orders of magnitude faster than plug-in methods.
  • Theoretical Guarantees: The paper provides finite-sample regret bounds for both batch and online algorithms, showing that their convergence rates are tied to the quality of the conditional probability estimator. For logistic regression, they achieve O(1/√n) sample complexity.

Limitations and Future Work

  • Assumption on Conditional Probability: The theoretical analysis relies on the conditional probability estimator being consistent and having certain regularity properties (continuous, differentiable, light-tailed).
  • Randomized Classifiers: The paper notes that when the probability mass at the optimal threshold is non-zero, a randomized classifier might be optimal, but for simplicity, they assume this probability is zero.
  • Inner Loop Iterations: For the online algorithm, the number of inner loop iterations for threshold optimization might increase with the desired accuracy for the threshold. The authors suggest that in practice, a fixed number of iterations often yields good results.
  • Future Work: The paper suggests exploring extensions to other types of metrics and more complex model families. The empirical results also hint at potential for further optimization and adaptation of the algorithms.

Summary updated

Abstract

We present a framework and analysis of consistent binary classification for complex and non-decomposable performance metrics such as the F-measure and the Jaccard measure. The proposed framework is general, as it applies to both batch and online learning, and to both linear and non-linear models. Our work follows recent results showing that the Bayes optimal classifier for many complex metrics is given by a thresholding of the conditional probability of the positive class. This manuscript extends this thresholding characterization -- showing that the utility is strictly locally quasi-concave with respect to the threshold for a wide range of models and performance metrics. This, in turn, motivates simple normalized gradient ascent updates for threshold estimation. We present a finite-sample regret analysis for the resulting procedure. In particular, the risk for the batch case converges to the Bayes risk at the same rate as that of the underlying conditional probability estimation, and the risk of proposed online algorithm converges at a rate that depends on the conditional probability estimation risk. For instance, in the special case where the conditional probability model is logistic regression, our procedure achieves $O(\frac{1}{\sqrt{n}})$ sample complexity, both for batch and online training. Empirical evaluation shows that the proposed algorithms out-perform alternatives in practice, with comparable or better prediction performance and reduced run time for various metrics and datasets.
BibTeX
@misc{yan2016online,
  author = {Bowei Yan and Oluwasanmi Koyejo and Kai Zhong and Pradeep Ravikumar},
  title = {{Online Classification with Complex Metrics}},
  year = {2016},
  eprint = {1610.07116},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1610.07116},
}
Figure