Introduction
Discretizing continuous data into bins is a fundamental preprocessing step in machine learning. It allows models to handle non-linear relationships by treating different ranges of a feature as distinct categories. However, the standard practice is to choose bin boundaries using simple heuristics—such as equidistant intervals or equal-frequency bins—independently of the model training process. This paper introduces a method to learn optimal, non-equidistant bin boundaries simultaneously with model parameters using a global convex optimization framework.
The Discretization Challenge
Many machine learning models, particularly linear classifiers and density estimators, benefit from discretization. For example, in histograms or linear embeddings, discretization allows a linear model to approximate non-linear decision boundaries. While supervised discretization algorithms exist (such as those used in decision tree induction), they typically rely on greedy, local search heuristics and are performed as a separate preprocessing step.
This creates a significant disconnect: the bin boundaries are not optimized for the final objective function of the model. The authors address this by formulating the joint learning of discretization parameters (the bin edges) and decision function parameters (the weights) as a single, globally optimal convex problem.
Methodology
The authors focus on learning Piece-Wise Constant (PWC) and Piece-Wise Linear (PWL) functions. Their approach relies on a mathematical reframing that avoids the combinatorial complexity of traditional bin selection:
- Initial Fine-Grained Discretization: The algorithm begins by slicing the feature space into a massive number of tiny, equidistant "proposal" bins. This provides a high-resolution starting point for the optimization.
- The $L_1$ Relaxation: To reduce the number of bins, the algorithm assigns a weight to each proposal bin. If two adjacent bins have the same weight, they effectively merge. While minimizing the number of unique bins is an NP-hard $L_0$-norm problem, the authors use an $L_1$-norm penalty (Total Variation) as a convex proxy. This forces adjacent weights to become identical, naturally forming wider, non-equidistant bins.
- Joint Optimization: This $L_1$ penalty is integrated directly into the main objective function (e.g., SVM hinge loss or Maximum Likelihood). The model jointly learns weights and bin structures via a standard Quadratic Programming solver.
- Rounding: To finalize the model, a dynamic programming step snaps the relaxed continuous weights back into a hard set of $B$ discrete bins.
Key Insights and Results
End-to-End Optimization
By bringing discretization into the main convex optimization loop, the model does not have to guess which bin boundaries will be useful. It learns exactly what it needs to minimize the true loss. This was particularly evident in the Malware Detection task, where the proposed method achieved a recall of 58.9% at a strict 95% precision point, compared to 53.5% for a baseline SVM. Remarkably, it achieved this while using nearly 80% fewer bins (58 learned bins vs. 256 equidistant bins).
PWC vs. PWL Functions
A fascinating discovery was the "flattening" effect observed in PWC functions. The $L_1$ penalty tends to penalize local extrema, pushing peaks and valleys together and favoring uniform distributions. This makes PWC less ideal for pure density estimation. In contrast, PWL functions do not suffer from this limitation, making them superior for approximating probability density functions.
Benchmarking
On 10 standard UCI classification benchmarks, the proposed PWL embedding matched or slightly outperformed leading heuristic methods. Crucially, it provided the theoretical guarantee of a global convex optimum, offering more robust results than non-convex clustering heuristics.
Limitations and Future Work
The primary drawback of this approach is computational cost. Solving the convex problem takes significantly longer than greedy heuristics, and the runtime scales poorly as the model is forced toward higher sparsity (fewer bins). However, the authors suggest that this framework is highly extensible and could be applied to a wide variety of convex learning algorithms beyond SVMs and Maximum Likelihood estimation.
Conclusion
This research demonstrates that discretization does not have to be a heuristic preprocessing step. By leveraging Total Variation as a clustering tool within a convex framework, researchers can produce highly compact and accurate models that are optimized end-to-end for their specific task.
Summary updated