Research
Principled Algorithms for Optimizing Generalized Metrics in Binary Classification
Overview Research area: Machine learning theory, specifically binary classification with non-standard performance metrics (F-measure family, AM measure, Jaccard similarity, weighted accuracy) and the

- arXiv
- 2512.23133
- Published
- 2025-12-29
- Authors
- Anqi Mao, Mehryar Mohri, Yutao Zhong
AI summary
Overview
Research area: Machine learning theory, specifically binary classification with non-standard performance metrics (F-measure family, AM measure, Jaccard similarity, weighted accuracy) and the design of surrogate loss functions with consistency guarantees.
Technical level: Advanced. The paper is written for readers comfortable with statistical learning theory, surrogate loss analysis, Bayes-consistency, and H-consistency bounds.
Scope: The paper reformulates generalized metric optimization as a general cost-sensitive learning problem, derives H-consistency and finite-sample guarantees for a new family of surrogate losses, and introduces algorithms named metro for optimizing these metrics under restricted hypothesis sets.
What This Paper Is About
Many real applications with class imbalance or asymmetric costs are better judged by metrics such as the F-beta measure, the AM measure, the Jaccard similarity coefficient, or weighted accuracy than by plain misclassification error. Existing methods for optimizing those metrics typically estimate class probabilities and then search for a threshold derived from the Bayes-optimal classifier, which gives only asymptotic guarantees and is not tailored to a restricted hypothesis set. This paper instead builds surrogate losses for these metrics that come with non-asymptotic, hypothesis-set-specific guarantees and uses them to derive new learning algorithms.
Key Contributions
-
An equivalent reformulation of generalized metric optimization. The paper defines a broad family of generalized metrics as a ratio of two expectations (Equation 2), covering the AM measure, F-beta measures, the Jaccard similarity coefficient, weighted accuracy, and others considered by Koyejo et al. (2014). It shows that minimizing the metric L(h) over a hypothesis set H is equivalent to minimizing the expected value of a difference loss ell^{lambda*} = ell_alpha - lambda* ell_beta, with lambda* = L*(H) (Theorem 3.1), and gives a non-asymptotic version of this equivalence (Theorem 3.2).
-
A general cost-sensitive surrogate loss framework. The target loss is expressed as a cost-sensitive loss with label-dependent costs gamma_i = alpha_i - lambda* beta_i plus a shift tau = |gamma_1| + |gamma_2| + |gamma_3| + |gamma_4| (Equation 4). The authors extend standard margin-based losses—exponential, logistic, quadratic, hinge, sigmoid, and rho-margin (Table 1)—to this general cost-sensitive setting via Equation 6.
-
H-consistency guarantees for the new surrogates. Theorem 4.1 shows that if a margin-based loss Phi admits a Gamma-H-consistency bound with respect to the zero-one loss with Gamma(t) = beta t^alpha, then its cost-sensitive surrogate admits a bound with Gamma-bar(t) = beta (2 L_max)^{1-alpha} t^alpha. Corollaries 4.2 and 4.3 specialize this to the family of all measurable functions, yielding explicit bounds: 2 sqrt(L_max t) for exponential and logistic losses, sqrt(2 L_max t) for the quadratic loss, and t for hinge, sigmoid, and rho-margin losses.
-
New algorithms (metro) and experiments. The paper introduces metro (Metric Optimization) algorithms with strong theoretical performance guarantees, including finite-sample learning bounds, and reports experiments comparing them to prior baselines.
Main Findings
-
Threshold methods are misaligned with restricted hypothesis sets. The paper shows through a two-dimensional example with linear classifiers (Section 5, Figure 1) that the best linear classifier found via a margin-maximizing classifier can have a significantly different orientation from the best linear classifier optimized for an F-beta measure. This motivates a hypothesis-set-specific analysis rather than one based on the Bayes-optimal classifier.
-
Bayes-consistency limits of prior work. Prior two-stage thresholding algorithms (Koyejo et al., 2014; Parambath et al., 2014) come with consistency-type guarantees, but consistency is asymptotic, provides no explicit convergence rates, and applies only to the class of all measurable functions, not to a restricted hypothesis class used in practice.
-
Equivalence of metric minimization and difference-loss minimization. Theorem 3.1 states that L(h*) = L*(H) for some h* in H holds if and only if the expected difference loss at h* equals its best-in-class value, zero. Theorem 3.2 states that for any eta >= 0 and h in H, the inequality on the difference loss holds if and only if L(h) - L*(H) <= eta / E[ell_beta(h,x,y)].
-
Explicit H-consistency bounds for cost-sensitive surrogates. In the case H = H_all, the estimation error of the cost-sensitive loss is bounded by Gamma-bar applied to the surrogate estimation error, with Gamma-bar(t) = 2 sqrt(L_max t) for Phi_exp and Phi_log, Gamma-bar(t) = sqrt(2 L_max t) for Phi_quad, and Gamma-bar(t) = t for Phi_hinge, Phi_sig, and Phi_rho. When the target loss takes values in [0, L_max], the general bound is Gamma-bar(t) = beta (2 L_max)^{1-alpha} t^alpha.
-
Minimizability gaps and approximation error. The general H-consistency bound contains a term Gamma-bar(M_{L_Phi}(H)) - M_L(H); the paper notes this is small and close to zero when the minimizability gaps (or their upper-bounding approximation errors) are small, and that these terms vanish when H = H_all.
-
Distinction from prior cost-sensitive approaches. The paper emphasizes that its algorithm minimizes a general cost-sensitive surrogate that is H-consistent with respect to a general cost-sensitive target loss with label-dependent costs, in contrast to the theta-weighted surrogate used by Koyejo et al. (2014) and Parambath et al. (2014), which approximates the Bayes-classifier threshold.
-
Experimental reporting. The abstract and Section 1 state that experiments demonstrate the effectiveness of the methods compared to prior baselines. The paper content provided does not report specific datasets, benchmark numbers, or baseline scores.
Methodology in Plain English
The starting point is the observation that many useful metrics can be written as one expectation divided by another, where both numerator and denominator are linear in the classifier's signed prediction and the label. That ratio form is awkward to optimize directly, so the authors replace it with an equivalent difference problem: minimize ell_alpha minus lambda times ell_beta, where lambda is set to the best achievable value of the metric on the hypothesis set. This difference turns out to be a cost-sensitive loss whose four cost values are simple combinations of the coefficients, which can be shifted to be non-negative by adding a constant. Because cost-sensitive losses are non-continuous and hard to optimize directly, the authors adapt familiar margin-based losses, such as the hinge, logistic, and exponential losses, by weighting each of the two prediction directions with the appropriate cost. They then prove that whenever a margin loss has a known consistency bound with respect to the zero-one loss, its cost-sensitive version has a corresponding bound with respect to the cost-sensitive target, and they read off concrete bound rates for each loss. To find the value of lambda used in practice, the paper mentions a binary search-based algorithm. Finally, these pieces are assembled into the metro algorithm family.
Why This Matters
Impact on research. The paper shifts the analysis of metric optimization away from Bayes-optimal threshold characterizations and toward H-consistency bounds, which are non-asymptotic, depend explicitly on the hypothesis set actually used, and yield finite-sample learning bounds. It also provides a general cost-sensitive surrogate framework that extends earlier theta-weighted surrogate constructions.
Real-world applications (settings the paper explicitly associates with these metrics):
- Fraud detection, where positive and negative classes are highly imbalanced.
- Medical diagnosis, where errors carry asymmetric costs.
- Information retrieval, where F-beta-style measures are standard.
- Any setting with asymmetrical classification costs, where weighted accuracy is preferred over the zero-one loss.
Industry relevance. The target setting is practical machine learning with restricted model classes such as linear models and neural networks, rather than the abstract class of all measurable functions. That makes the guarantees directly relevant to practitioners who have already committed to a model family and need to optimize a business-relevant metric rather than plain accuracy.
Future Directions
- Experiments on the broader generalized metric family. The paper's theoretical framework covers any metric expressible as a ratio of two linear combinations of TP, FP, TN, and FN statistics; the content provided does not report which metrics were tested or on which datasets.
- The role of minimizability gaps and approximation error. The general H-consistency bound contains a gap term that vanishes only in the H = H_all case; understanding how large these terms are for common restricted hypothesis classes remains an open question raised by the analysis.
- Practical algorithms for computing lambda and the label-dependent costs.* The paper notes that the value can be approximated through a binary search-based algorithm, leaving room for work on efficient and accurate procedures, particularly in connection with the metro algorithms.
- Comparison with stability-based guarantees. Prior work by Parambath et al. (2014) provides stability-type guarantees whose analysis the paper describes as lacking explicit details; a natural next step is a systematic comparison of the finite-sample bounds obtained here against those alternative guarantee types.
Target Audience
Researchers in statistical learning theory and machine learning who work on surrogate loss design, consistency, and generalization bounds; graduate students familiar with Bayes-consistency and H-consistency concepts; and applied machine learning practitioners working on imbalanced classification or cost-sensitive problems who want algorithms grounded in theory, provided they are comfortable with the paper's mathematical development.
Authors’ abstract
In applications with significant class imbalance or asymmetric costs, metrics such as the $F_β$-measure, AM measure, Jaccard similarity coefficient, and weighted accuracy offer more suitable evaluation criteria than standard binary classification loss. However, optimizing these metrics present significant computational and statistical challenges. Existing approaches often rely on the characterization of the Bayes-optimal classifier, and use threshold-based methods that first estimate class probabilities and then seek an optimal threshold. This leads to algorithms that are not tailored to restricted hypothesis sets and lack finite-sample performance guarantees. In this work, we introduce principled algorithms for optimizing generalized metrics, supported by $H$-consistency and finite-sample generalization bounds. Our approach reformulates metric optimization as a generalized cost-sensitive learning problem, enabling the design of novel surrogate loss functions with provable $H$-consistency guarantees. Leveraging this framework, we develop new algorithms, METRO (Metric Optimization), with strong theoretical performance guarantees. We report the results of experiments demonstrating the effectiveness of our methods compared to prior baselines.