Introduction
Discretization is a fundamental preprocessing step in machine learning, particularly for algorithms like decision trees and rule-based learners that require categorical input. While supervised discretization methods leverage class labels to find optimal cut-points, unsupervised scenarios—where labels are absent—rely on simpler heuristics. Traditional unsupervised methods, such as Equal-Width and Equal-Frequency binning, often fail to capture the underlying data distribution, especially in the presence of skewness or outliers. This paper presents a principled approach to unsupervised discretization using Kernel Density Estimation (KDE) to identify natural structures in continuous data.
Methodology: Density Comparison and Scoring
The proposed method is a top-down, global discretization algorithm that treats the discretization task as a density estimation problem. The core innovation lies in comparing two distinct representations of data density:
- Simple Binning ($f$): A piecewise constant density estimation, similar to a standard histogram, where the density is assumed to be uniform within each interval.
- Kernel Density Estimation ($p$): A non-parametric, smooth estimation where each data point contributes to the overall density based on a kernel function.
The algorithm evaluates potential cut-points by calculating a scoring function based on the absolute difference between these two densities: $Score(T) = \sum |p(x_i) - f(x_i)|$. A high score indicates that the current binning poorly represents the true underlying distribution, signaling the need for a split.
Top-Down Splitting and Stopping Criterion
The algorithm employs a priority queue to iteratively refine the discretization by splitting the interval with the highest error (worst fit). To prevent overfitting—where the model might create too many bins—the authors use 10-fold cross-validated log-likelihood as a stopping criterion. This ensures the chosen number of intervals maximizes the model's generalizability to unseen data. Despite the potential $O(N^2)$ complexity of KDE, optimized univariate algorithms allow the method to scale with a complexity of $O(N \log N)$.
Experimental Evaluation
The researchers benchmarked the KDE-based method using 200 continuous attributes extracted from 12 classic datasets in the UCI Machine Learning Repository, including wine, glass, heart, and ionosphere. The performance was compared against three baseline methods: Equal-Width (10 bins), Equal-Frequency (10 bins), and Equal-Width with cross-validation.
Results
The results demonstrate the significant advantages of the KDE approach. Using a paired t-test on cross-validated log-likelihood (with $\alpha = 0.05$), the KDE method outperformed the baselines in a substantial percentage of cases.
Specifically, the KDE method was significantly more accurate than Equal-Width (10 bins) in 35.5% of cases and better than Equal-Frequency in 39.5% of cases. Crucially, the method was significantly worse than the baselines in only a tiny fraction of instances (1.0% to 5.0%), suggesting it offers a high "up-side" with minimal risk.
Conclusion
The KDE-based discretization method provides a robust, principled alternative to heuristic-based unsupervised binning. By using KDE as a "ground truth" to guide histogram refinement, the algorithm successfully identifies natural clusters and handles skewed data more effectively than traditional methods. Future work will explore multivariate extensions to account for interactions between variables and applications in complex domains like Inductive Logic Programming (ILP).
Summary updated