Skip to main content

VBPCApy

License: MIT Python 3.11+ Code style: ruff DOI Docs

Variational Bayesian PCA (Ilin & Raiko, 2010) with support for missing data, sparse masks, optional bias terms, and an orthogonal post-rotation to a PCA basis. The implementation follows the original MATLAB reference while adding Python-native APIs, fast C++ extensions, and runtime autotuning.

Documentation · API Reference · Tutorials

Statement of need

Missing values are common in scientific and industrial tabular datasets, but many analysis pipelines either impute first (masking uncertainty) or drop incomplete samples. VBPCApy models missingness directly and exposes posterior uncertainty outputs alongside reconstructions, enabling uncertainty-aware latent-factor analysis in a single reproducible Python API.

Installation

From PyPI (pre-built wheels for Python 3.11–3.14, Linux/macOS/Windows):

pip install vbpca-py

With plotting support:

pip install vbpca-py[plot]

See the installation guide for building from source and Eigen setup.

Quick start

import numpy as np
from vbpca_py import VBPCA

# 50 features, 200 samples
x = np.random.randn(50, 200)
mask = np.ones_like(x)  # 1 = observed, 0 = missing

model = VBPCA(n_components=5, maxiters=100)
scores = model.fit_transform(x, mask=mask)
recon = model.reconstruction_
var = model.variance_

More examples: quickstart, dense PCA tutorial, missing data & model selection, genomics dosage data, and sparse data.

Features

  • Dense or sparse data with explicit missing-entry masks
  • Optional bias estimation and rotation to PCA-aligned solution
  • Posterior covariances for scores and loadings; held-out probe RMS
  • C++ extensions with runtime autotune for threading and memory
  • Missing-aware preprocessing: one-hot, standard/minmax scaling, log, power, winsorize, auto-routing (AutoEncoder)
  • Preflight data diagnostics via check_data() / DataReport
  • scikit-learn-compatible estimator (fit/transform/inverse_transform, get_params/set_params, cloning) — scikit-learn is an optional dependency
  • Model selection via select_n_components and cross_validate_components
  • Configurable convergence: subspace angle, RMS/cost plateau, ELBO, curvature, composite rules, patience, with per-criterion enable/disable and custom ordering
  • Convergence diagnostics (n_iter_, converged_, convergence_reason_, learning_curve_, best-probe state metadata) and calibrated predictive_variance_ (includes observation noise)
  • recommend_config(n, p, priority) — regime-aware default hyperparameters from a surrogate trade study

See the concept guides and API reference for full details.

Development

git clone https://github.com/yoavram-lab/VBPCApy.git
cd VBPCApy
uv sync --extra dev --extra plot
just ci          # lint + typecheck + test
just docs-serve  # local docs preview

See CONTRIBUTING.md for guidelines.

Citation

If you use this package in your research, please cite:

@software{vbpca_py2026,
  author = {Macdonald, Joshua and Naim, Shany and Ram, Yoav},
  title = {{VBPCApy}: Variational Bayesian PCA with Missing Data Support},
  year = {2026},
  url = {https://github.com/yoavram-lab/VBPCApy},
  version = {0.4.4},
}
@article{ilin2010practical,
  title={Practical Approaches to Principal Component Analysis in the Presence of Missing Values},
  author={Ilin, Alexander and Raiko, Tapani},
  journal={Journal of Machine Learning Research},
  volume={11},
  pages={1957--2000},
  year={2010}
}

See CITATION.cff for machine-readable metadata.

License

MIT — see LICENSE.

Metadata

Release files for vbpca-py 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vbpca-py 0.4.4
File Size Uploaded
vbpca_py-0.4.4.tar.gz 277.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for vbpca-py 0.4.4
File
vbpca_py-0.4.4-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
vbpca_py-0.4.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
vbpca_py-0.4.4-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
vbpca_py-0.4.4-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
vbpca_py-0.4.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
vbpca_py-0.4.4-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
vbpca_py-0.4.4-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
vbpca_py-0.4.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
vbpca_py-0.4.4-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
vbpca_py-0.4.4-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
vbpca_py-0.4.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
vbpca_py-0.4.4-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details

Total release size: 56.8 MB

Release files / vbpca_py-0.4.4.tar.gz

Download URL vbpca_py-0.4.4.tar.gz
Size 277.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0c4cd9a158df2d1ad637b7ff7ec0629c2a525b5187213356b8a99b121425fef6
BLAKE2b-256 checksum
How to use checksums
fb40aa21258078ffaceb1d3b4495da4c03a3c540b358c994108df67015c75e8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / vbpca_py-0.4.4-cp314-cp314-win_amd64.whl

Download URL vbpca_py-0.4.4-cp314-cp314-win_amd64.whl
Size 1.0 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
a0479e9c5e69457703778b59927e51de6f3d88d6eb289a452de826fc74db3dc0
BLAKE2b-256 checksum
How to use checksums
4aae09ba4c6beb1a9cd741334c6872530a777fbeda21cdce73bf37a06b4fdf72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / vbpca_py-0.4.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL vbpca_py-0.4.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 12.4 MB
Tags CPython 3.14 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8ca05d7ae2ada40c36419610e4c638db7c4064137f9c51d0f7f7813b06085ec0
BLAKE2b-256 checksum
How to use checksums
91e734d8b9cf1f11ae7282b4649ac7b9764aca5286bfb8815f3de3e7e3e245d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / vbpca_py-0.4.4-cp314-cp314-macosx_11_0_arm64.whl

Download URL vbpca_py-0.4.4-cp314-cp314-macosx_11_0_arm64.whl
Size 816.3 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e61df7f0ed390cfb15561afd60d97c3cfbc0c7289d1ba4b877b00f51a3e62eb1
BLAKE2b-256 checksum
How to use checksums
3586d58be68db2c0b983d13774e902446633f21cb5a8c73084168ab466e49dfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / vbpca_py-0.4.4-cp313-cp313-win_amd64.whl

Download URL vbpca_py-0.4.4-cp313-cp313-win_amd64.whl
Size 981.3 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
f6a4d9fbf811a6e172f01d0f1a6d1b7b649538d2d40a8dbcdc05d246c514739b
BLAKE2b-256 checksum
How to use checksums
b577a2bf35507d05a676fdc2a54fd24a701f08370e5b9eae24ec5244f27bf6c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / vbpca_py-0.4.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL vbpca_py-0.4.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 12.4 MB
Tags CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
460f113a65d90b07a29ddd2b74ed716b370e1b889b8fddad36b647c41472826f
BLAKE2b-256 checksum
How to use checksums
2af900da620fe99a07a23df2743d9c180fd9ec79976662c47472d1e92a3fef07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / vbpca_py-0.4.4-cp313-cp313-macosx_11_0_arm64.whl

Download URL vbpca_py-0.4.4-cp313-cp313-macosx_11_0_arm64.whl
Size 815.9 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
96e30ac648bb037ffa255229d4d9ff0a8a8b7a79e43af3532ef38d401799124a
BLAKE2b-256 checksum
How to use checksums
8ac605220ce62dd5e2bceeaae92ffba4c68a23d8408c700bd647b247cd4dc00f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / vbpca_py-0.4.4-cp312-cp312-win_amd64.whl

Download URL vbpca_py-0.4.4-cp312-cp312-win_amd64.whl
Size 981.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
9c2dd03696356d81f64379445ffa673a0d9987b765179345dee7fc6029785af2
BLAKE2b-256 checksum
How to use checksums
fce5797fb299d9789a7234ffbc3b67e90f66f851f45fa8903f741a1f3a563830
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / vbpca_py-0.4.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL vbpca_py-0.4.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 12.4 MB
Tags CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
66290f6ee53596ce6a8adc7805f67222d4e9bd3238d9e83291afa899a04dd999
BLAKE2b-256 checksum
How to use checksums
57843b2fdaa1ed5a45b2bbc2e9647c2138f056fae1437916f969d3e2aa8de2e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / vbpca_py-0.4.4-cp312-cp312-macosx_11_0_arm64.whl

Download URL vbpca_py-0.4.4-cp312-cp312-macosx_11_0_arm64.whl
Size 815.4 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1b772a8b6fc8d833f40780ce6bb437c67fd0b5b963255697b45049ceab339f4b
BLAKE2b-256 checksum
How to use checksums
a0d218973ba263fb6c75caf5ba4291e68759821c06328f89bd0d9898928c258a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / vbpca_py-0.4.4-cp311-cp311-win_amd64.whl

Download URL vbpca_py-0.4.4-cp311-cp311-win_amd64.whl
Size 965.0 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
443f1de7ded8276b30e3d6ab94d56d604b5d73d7d7b240f093f9d97e14e5f19a
BLAKE2b-256 checksum
How to use checksums
627b71ca89ee898b890229dc134283e4b99aaafe1b9777f763e1cc42d86a93d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / vbpca_py-0.4.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL vbpca_py-0.4.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 12.2 MB
Tags CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1777c4573167e07beb77f21528e3e95ae0407f05917d0dfe709c39e0fd6da9db
BLAKE2b-256 checksum
How to use checksums
8b145d1a9f4f1a49a6349ff5a5106b53d441c302ffb26a866718a8addbc0ccef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / vbpca_py-0.4.4-cp311-cp311-macosx_11_0_arm64.whl

Download URL vbpca_py-0.4.4-cp311-cp311-macosx_11_0_arm64.whl
Size 799.3 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b2937c14fa4b8aa8b792e445fa974ceee4a1e940d13407c87321810362217c77
BLAKE2b-256 checksum
How to use checksums
5947588a85ad60db9c05592156470642fe545ed056e03b0fc1342c862ed8645a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.6

13 release files

This release

0.4.4 This release

13 release files

0.4.3

10 release files

0.4.2

10 release files

0.4.0

10 release files

0.3.0

10 release files

0.2.0

10 release files

0.1.1

10 release files

0.1.0

10 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page