vbpca-py
Variational Bayesian PCA for incomplete data with full posterior uncertainty, calibrated predictive variance, automatic component pruning, native missingness handling, and C++-accelerated kernels.
vbpca-py is a variational Bayesian PCA framework for incomplete data. It jointly infers latent components, noise variance, and effective dimensionality while propagating full posterior uncertainty (covariances on loadings, scores, and bias) through the entire estimation pipeline.
Key features:
- Native per-entry missingness handling via shared observation patterns that reuse matrix factorizations — no imputation required
- Automatic Relevance Determination prunes uninformative components; built-in model selection sweep identifies optimal rank
- Calibrated predictive variance (
predictive_variance_) that folds in observation noise, restoring nominal prediction-interval coverage on noisy held-out entries - Regime-aware default hyperparameters (
recommend_config) distilled from a surrogate-based trade study, tuned to maximize correct rank recovery - Missing-aware preprocessing pipeline: one-hot encoding, scaling, power transforms, winsorization
- C++-accelerated kernels via pybind11 with runtime autotuning for performance-critical updates
- Full scikit-learn-compatible estimator API (
fit,transform,get_params/set_params, cloning) — scikit-learn is an optional dependency
Applied to genetic, cultural, and ecological datasets. Available on PyPI and archived at Zenodo.
The 2024 preprint (Macdonald et al., 2024) introduced an earlier, single-statistic version of the posterior predictive rank-testing methodology built on this codebase; a fuller three-layer treatment is in preparation as the standalone pp-eigentest paper.