Abstract
This paper investigates the application of stacked generalization, or "stacking," to the problem of unsupervised density estimation. Traditionally, researchers rely on model selection via cross-validation to choose a single "best" model, such as a specific Gaussian mixture or kernel density estimator. However, this approach often ignores model uncertainty. The authors propose a method to linearly combine multiple density estimators using weights optimized through cross-validation. Experimental results across various real-world and synthetic datasets demonstrate that stacking consistently outperforms traditional model selection, often exceeding the performance of the single best-performing model on the test set ("cheating") and providing superior regularization in small-sample scenarios.
Introduction
In multivariate density estimation, practitioners typically choose between different model classes, such as Finite Mixture Models (FMM) or Kernel Density Estimation (KDE), and must further select hyperparameters like the number of components ($k$) or kernel bandwidth ($h$). The standard practice of model selection—using cross-validation to pick one model and discard others—is statistically wasteful, especially when multiple models perform similarly. While Bayesian Model Averaging (BMA) provides a theoretical framework for combining models, it is often computationally prohibitive or sensitive to prior specifications. This work introduces stacking as a robust, data-driven alternative that effectively manages model uncertainty by averaging over a pool of candidate estimators.
Methodology
The proposed stacking framework for density estimation follows a structured five-step process:
- Partitioning: The training data is divided into $v$ folds (e.g., 10-fold cross-validation).
- Out-of-Sample Evaluation: For each fold, $M$ candidate models are trained on $v-1$ folds. The likelihood of the held-out data is then calculated for each model.
- Weight Optimization: This generates an $N \times M$ matrix of out-of-sample likelihoods. The goal is to find a set of weights $\alpha$ that maximize the log-likelihood of the linear combination: $f_{stacked}(x) = \sum_{m=1}^M \alpha_m f_m(x)$.
- EM Algorithm: Since the linear combination is itself a mixture model with fixed component densities, the Expectation-Maximization (EM) algorithm is employed to efficiently determine the optimal weights.
- Final Model Construction: The candidate models are re-trained on the full dataset and combined using the optimized $\alpha$ weights.
The ensemble typically incorporates a diverse pool of models, such as triangular kernels with varying bandwidths and Gaussian mixture models with different numbers of components.
Experimental Setup
The methodology was evaluated on both real-world and synthetic datasets:
- Real-World Data: Included the Diabetes dataset (145 points), Fisher’s Iris (150 points, 4D), Vowel (639 points, 2D multi-modal), and Star-galaxy (499 points, 7D).
- Synthetic Data: 1D Gaussian mixtures were used to visualize "effective kernels," and a 2D 4-component Gaussian mixture was used to assess performance when the ground-truth model structure is known.
Results and Discussion
The experimental results indicate that stacking is a highly effective strategy for density estimation.
Key Findings
- The Effective Kernel: Stacking allows for the creation of composite "effective kernels." By mixing kernels of different widths, the model can capture sharp local features while maintaining heavy tails to handle outliers.
- Regularization and Robustness: In small-sample regimes, stacking often outperforms the "true" model structure (e.g., $k=4$ Gaussians) because it spreads weight across simpler models, providing a regularization effect that prevents overfitting.
- Superiority over Selection: Stacking consistently outperformed a "Cheating" baseline—the single model that performed best on the test set. This suggests that the ensemble is fundamentally more expressive than any individual model in the pool.
- Stability: As the complexity of the model pool increases, stacking remains stable, whereas traditional cross-validation selection often suffers from performance degradation due to overfitting.
Conclusion
Stacking provides a powerful and flexible framework for density estimation that avoids the pitfalls of rigid model selection. While it incurs a higher computational cost due to the requirement of training multiple models across cross-validation folds, the gains in generalization performance and robustness are significant. Future work may explore non-linear stacking methods, such as "mixtures of experts," where weights vary based on the input space, as well as more automated methods for populating the initial model pool.
Summary updated