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.5},
}
@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.5

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.5
File Size Uploaded
vbpca_py-0.4.5.tar.gz 284.0 kB Details

Built distributions (wheels)

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

Total release size: 56.9 MB

Release files / vbpca_py-0.4.5.tar.gz

Download URL vbpca_py-0.4.5.tar.gz
Size 284.0 kB
Tags Source
SHA-256 checksum
How to use checksums
09d5a42c5e5d6ad8007d7b6aa16bf665fe373e9ee986ce916f8b09e59e9862fe
BLAKE2b-256 checksum
How to use checksums
c90095f0055eb5a6655c262e4e9b730d67045cfd49b1ec4d0f225c7072d989ce
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.5-cp314-cp314-win_amd64.whl

Download URL vbpca_py-0.4.5-cp314-cp314-win_amd64.whl
Size 1.0 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
880762a6770cbf53136237431984eb8ca9bdaf8fcbdea46f5af73f76661130dd
BLAKE2b-256 checksum
How to use checksums
d141b974a325cd2b08b35078402396df6798344b45d5a0c9ef409eeaa8a6289d
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.5-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL vbpca_py-0.4.5-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
efba92a1ef7179f1f913fe870227070041fbf9a18f24b1d2a2d9402994703a3c
BLAKE2b-256 checksum
How to use checksums
7a7990dd82b557b16481e2e30c9b9cf5639fbcbd206978fe5d331878af359cde
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.5-cp314-cp314-macosx_11_0_arm64.whl

Download URL vbpca_py-0.4.5-cp314-cp314-macosx_11_0_arm64.whl
Size 820.8 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
dc1d2b3687ef914555f36db559a7e70b1f63e9da3bbd9340b2eb318a043e04d7
BLAKE2b-256 checksum
How to use checksums
a7585e6233145b8b84eca00c4d689f7b9d779406c0569c41e33c99cdbd5a8d39
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.5-cp313-cp313-win_amd64.whl

Download URL vbpca_py-0.4.5-cp313-cp313-win_amd64.whl
Size 985.9 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
429514f931e094c51c2cd35e3edb68855291e314f25cba07f571782981c6ae44
BLAKE2b-256 checksum
How to use checksums
5733f6e2aea53d3b1993c7f8a87bacde3bd55d8d5c7a87d5a92be432f625f667
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.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL vbpca_py-0.4.5-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
3b100489584f7b937cb6e0640fba17a8f1bca46fb32061a83defde4c20f8aa44
BLAKE2b-256 checksum
How to use checksums
153c9edf0484dd210a3f68a9d618ca7294124babecf582b72398d1f5323a151d
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.5-cp313-cp313-macosx_11_0_arm64.whl

Download URL vbpca_py-0.4.5-cp313-cp313-macosx_11_0_arm64.whl
Size 820.5 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f3c6abbf4634586179edd939d65e4b40561dca44e5a8250fca9fecc13e686d62
BLAKE2b-256 checksum
How to use checksums
14d5726d484eda0053db07e85d632fd87b2667d0379f691b5f698cf0555e6390
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.5-cp312-cp312-win_amd64.whl

Download URL vbpca_py-0.4.5-cp312-cp312-win_amd64.whl
Size 985.5 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
c615f3f822d8d054758d2bba80d8344045b4ba9a9862686bfd7c46ec44014908
BLAKE2b-256 checksum
How to use checksums
95008732c06da03651d20782ceed847a8d299cd7e6bf3d8da40c44e015fb8c39
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.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL vbpca_py-0.4.5-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
11feb7be702108d51651d7679c8617b9bd795c1467bceaacc39e81926b321e28
BLAKE2b-256 checksum
How to use checksums
206b8a799700dc29df4196b017b29898d2cb1c97251b0304fb02ae65e0d5512e
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.5-cp312-cp312-macosx_11_0_arm64.whl

Download URL vbpca_py-0.4.5-cp312-cp312-macosx_11_0_arm64.whl
Size 820.0 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3adeda5908790305c95d8cff774e23e60cf07309bb8b0108c96d605590bf34a8
BLAKE2b-256 checksum
How to use checksums
5bd6d9c3f061980962db7cf7f4f7d8924e25dd481e4336e85821d425f58b2645
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.5-cp311-cp311-win_amd64.whl

Download URL vbpca_py-0.4.5-cp311-cp311-win_amd64.whl
Size 969.6 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
7f66b3d8eaf2538f4d5eb9ddaceffcf549cf27ba1a433efd95726359f6b636e6
BLAKE2b-256 checksum
How to use checksums
b00498f066ac7c1aca7daef18458a2117a23bae47659910ae3a54367d35ca0fd
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.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL vbpca_py-0.4.5-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
1595a7f9c7685eada1b1ad0957889ab3d000cc57c70cdb4eccfc4780f935f155
BLAKE2b-256 checksum
How to use checksums
b7fafad65d28c7547c7dcb24c73d2e3813eef5b9650eeaf2c57ed871deaa983d
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.5-cp311-cp311-macosx_11_0_arm64.whl

Download URL vbpca_py-0.4.5-cp311-cp311-macosx_11_0_arm64.whl
Size 803.9 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3ed68e3e08fd6511888f49da7b9c972e91c0f7d56f882a6bad5f312b26b0c728
BLAKE2b-256 checksum
How to use checksums
b3f6dee7c2720a47cd33e43137f70db6f2379d640120aad6045ec4d8f15773a1
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.5 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