vbpca-py

Find shared patterns in incomplete datasets and assess uncertainty in those summaries.

vbpca-py finds a smaller set of patterns that summarize an incomplete dataset. It fits variational Bayesian principal component analysis (PCA) to observed entries, estimating latent components, noise variance and approximate uncertainty in the fitted quantities.

Public; package maturity: beta; latest released version: v0.5.0 (final) on PyPI · v0.5.0 archive · all archived versions · Development documentation and examples

The package provides missing-aware preprocessing, component pruning, comparisons of candidate ranks, fit diagnostics and a scikit-learn-style fitting interface. The fitted scores_ array contains joint variational means for the training rows. VBPCA.transform instead computes conditional latent means for supplied rows, including new samples, and transform_posterior also returns conditional latent covariance matrices. Predictive variance includes observation noise, but these variational uncertainty approximations require coverage assessment for the intended data and missingness pattern.

The 2024 cultural-transmission paper used this codebase. A 2024 preprint introduced an earlier posterior predictive rank-testing method. Follow-up pp-eigentest research studies signal-rank selection; its methods and software remain in development.

A synthetic two-pattern signal, noisy observed entries with unobserved cells in gray, and a VBPCA reconstruction. Held-out observations are excluded from fitting. This illustration does not establish rank selection or uncertainty calibration.
A synthetic signal, noisy observed entries and reconstruction. Gray cells were excluded from fitting; the model uses two components.

Computed example, inputs and checks

Three panels: missing-aware one-hot encoding of synthetic categorical data, archetype memberships recovered from a VBPCA reconstruction in a triangle, and recovered against generating memberships.
Missing-aware one-hot encoding, VBPCA and archetypal analysis on synthetic categorical data generated from three archetypes, following the steps of the 2024 cultural-transmission paper.

Archetype example, inputs and checks

Method diagram (SVG) · Vector PDF · All figure sources and downloads

References