Abstract
Generative classifiers are constructed on the basis of a joint probability distribution and are typically learned using closed-form procedures that rely on data statistics and maximize scores related to data fitting. However, these scores are not directly linked to supervised classification metrics such as the error, i.e., the expected 0-1 loss. To address this limitation, we propose a learning procedure called risk-based calibration (RC) that iteratively refines the generative classifier by adjusting its joint probability distribution according to the 0-1 loss in training samples. This is achieved by reinforcing data statistics associated with the true classes while weakening those of incorrect classes. As a result, the classifier progressively assigns higher probability to the correct labels, improving its training error. Results on 20 heterogeneous datasets using both naïve Bayes and quadratic discriminant analysis show that RC significantly outperforms closed-form learning procedures in terms of both training error and generalization error. In this way, RC bridges the gap between traditional generative approaches and learning procedures guided by performance measures, ensuring a closer alignment with supervised classification objectives.
Introduction: Bridging the Generative-Discriminative Gap
In machine learning, practitioners often navigate a trade-off between generative and discriminative philosophies. Generative models, such as Naïve Bayes, aim to model the full joint distribution of data, offering robustness to missing values and intuitive probabilistic interpretations. Conversely, discriminative models focus solely on the decision boundary, often achieving superior accuracy by directly minimizing classification error.
Generative models typically lose the "accuracy race" because their standard training objective—maximizing likelihood—is task-agnostic. It optimizes for data fit rather than the actual goal: minimizing the expected 0-1 loss. Risk-based Calibration (RC) is a novel iterative method that imbues generative models with the competitive edge of discriminative learning without losing their probabilistic integrity.
The Challenge of Generative Learning
Generative classifiers like Naïve Bayes or Quadratic Discriminant Analysis (QDA) are usually trained via closed-form procedures. While computationally efficient, these methods do not explicitly account for classification performance.
When researchers attempt to improve these models using standard optimization techniques like Gradient Descent (GD), they encounter significant hurdles. Generative parameters are often subject to strict mathematical constraints (e.g., covariance matrices must be positive semi-definite). Standard GD can easily push parameters into "illegal" regions, necessitating complex and expensive projection steps to maintain model validity.
Risk-based Calibration (RC)
The proposed RC algorithm circumvents these issues by operating on sufficient statistics rather than raw parameters. The process follows an iterative heuristic:
- Initialization: The model is initialized using standard Maximum Likelihood Estimation (MLE).
- Soft 0-1 Loss Evaluation: The algorithm calculates the "soft error"—the probability the current model assigns to incorrect classes ($1 - p(y|x)$).
- Statistical Update: For each training instance, the algorithm updates the sufficient statistics (counts or sums). It "strengthens" the statistics for the true class and "weakens" those for incorrect classes, with the magnitude of the update weighted by the model's current uncertainty.
- Guaranteed Validity: Because parameters are derived from these updated statistics using standard formulas, the model is guaranteed to remain mathematically valid without additional constraints.
Experimental Evaluation
The researchers evaluated RC across 20 heterogeneous datasets from the UCI repository and other benchmarks, ranging from the 150-instance Iris dataset to the 70,000-instance MNIST. For complex image data like CIFAR-10 and Fashion-MNIST, high-dimensional features were extracted using a pre-trained ResNet18 backbone.
Key Results and Discussion
The application of RC to Naïve Bayes (NB) and Quadratic Discriminant Analysis (QDA) yielded significant performance gains:
- Superior Accuracy: For NB, RC outperformed MLE in 18 of 20 datasets for training error and 17 of 20 for test error.
- Significant Error Reduction: In QDA, the improvements were even more pronounced. For instance, in one benchmark, RC reduced training error from 20% to just 2%.
- Efficiency and Stability: RC consistently matched or exceeded the performance of Gradient Descent while often converging in significantly fewer iterations.
As shown in the table above, the "soft" error metric decreases substantially over iterations (from 0.23 to 0.03), demonstrating the effectiveness of the iterative refinement process. The values for specific instances $(x,y)$ show how the model progressively assigns higher probability to the correct labels.
Conclusion
Risk-based Calibration successfully bridges the gap between generative modeling and discriminative performance. By shifting the focus from parameter optimization to statistical refinement, RC provides a robust, efficient, and mathematically sound way to enhance generative classifiers. Future work may explore applying RC to more complex probabilistic structures, such as Bayesian Networks or Hidden Markov Models.
Reference: Pérez, A., Echegoyen, C., & Santafé, G. (2025). Risk-based Calibration for Generative Classifiers. arXiv:2409.03542v2.
Summary updated