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, 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)
  • Model selection via select_n_components and cross_validate_components
  • Configurable convergence: subspace angle, RMS/cost plateau, ELBO, curvature, composite rules, patience

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vbpca_py-0.3.0.tar.gz (211.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vbpca_py-0.3.0-cp313-cp313-win_amd64.whl (754.8 kB view details)

Uploaded CPython 3.13Windows x86-64

vbpca_py-0.3.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (11.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

vbpca_py-0.3.0-cp313-cp313-macosx_11_0_arm64.whl (774.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

vbpca_py-0.3.0-cp312-cp312-win_amd64.whl (754.4 kB view details)

Uploaded CPython 3.12Windows x86-64

vbpca_py-0.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (11.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

vbpca_py-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (773.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

vbpca_py-0.3.0-cp311-cp311-win_amd64.whl (738.3 kB view details)

Uploaded CPython 3.11Windows x86-64

vbpca_py-0.3.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (11.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

vbpca_py-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (758.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file vbpca_py-0.3.0.tar.gz.

File metadata

  • Download URL: vbpca_py-0.3.0.tar.gz
  • Upload date:
  • Size: 211.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vbpca_py-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c2966c576b059a2c09803da161211e04a316f4babc3668e02f0e78de59854bcd
MD5 807966b4a7378e2f43313deb2539f47b
BLAKE2b-256 0e468e147a76a54c424c681d63f82639a4d9e135221a8f643e0882fafb43ce47

See more details on using hashes here.

Provenance

The following attestation bundles were made for vbpca_py-0.3.0.tar.gz:

Publisher: publish.yml on yoavram-lab/VBPCApy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vbpca_py-0.3.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: vbpca_py-0.3.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 754.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vbpca_py-0.3.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 34b65ee95af81977fabb80ea08a36c5c9bb2d9f0adc54fc29e80983932c98338
MD5 af52b6f2d4fc9c5eed28522427cc260f
BLAKE2b-256 13f3dc86fbcd72d6e923cdd4b24875fd65f9e97712c4f4d23fe7f7c31c124ade

See more details on using hashes here.

Provenance

The following attestation bundles were made for vbpca_py-0.3.0-cp313-cp313-win_amd64.whl:

Publisher: publish.yml on yoavram-lab/VBPCApy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vbpca_py-0.3.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vbpca_py-0.3.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5f33176649471df1da93d45550d0bc316978659fea7f1bbf8f8ee3d3fbd0daa1
MD5 1c1494396397502521fb98d97a1d8c92
BLAKE2b-256 a3f65c26367ca56fec55019712e348026af32f8ac4f29ec22e83a1ebc345dd74

See more details on using hashes here.

Provenance

The following attestation bundles were made for vbpca_py-0.3.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on yoavram-lab/VBPCApy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vbpca_py-0.3.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vbpca_py-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a94daebf860b4d8901c9cf49f492f520c02c47491a77aabed75a52fe2345a52e
MD5 63153646347cd57249ee02501aee46a1
BLAKE2b-256 e1038ee6f76524257a706b8324e35075604c33dafd6fda1c6ad0e6522a4d6e8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for vbpca_py-0.3.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish.yml on yoavram-lab/VBPCApy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vbpca_py-0.3.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: vbpca_py-0.3.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 754.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vbpca_py-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0db7ddcefba294bae3dd40b2dc9b84cbfe66956b10098145125ec767cad2afb7
MD5 5009425efeaf869132b79ada93839547
BLAKE2b-256 e2c74eb1b921574627ae5d2bcd0bf709c404abeec1800cbda48e93e36aa193ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for vbpca_py-0.3.0-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on yoavram-lab/VBPCApy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vbpca_py-0.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vbpca_py-0.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 df68a89f31631de555b1c731285e132015f00cf9066303122f4f775581bcb188
MD5 7e9751779ebb65463afc046bf14b89ad
BLAKE2b-256 611c79c43695790af375f299ba88fea5bce7fb363df5e658a355d382a5333fa4

See more details on using hashes here.

Provenance

The following attestation bundles were made for vbpca_py-0.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on yoavram-lab/VBPCApy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vbpca_py-0.3.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vbpca_py-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c7f53585d28d2a4b4d8f60756efdf0066ef07e039229d84c225ee0f90462c6e7
MD5 acf3d67e9b4096f4772d146c652fff6d
BLAKE2b-256 e7786d1fc2ddd09e0ca3cabb44c5c0758e96c8232df13b4d518fd3b843999857

See more details on using hashes here.

Provenance

The following attestation bundles were made for vbpca_py-0.3.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on yoavram-lab/VBPCApy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vbpca_py-0.3.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: vbpca_py-0.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 738.3 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vbpca_py-0.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 585c09dca92f53c761b808776f97335ca98d6be06f53c7490dd1da4f98bdc349
MD5 620b0347e18d3e1ff0ca23cc3ec326a0
BLAKE2b-256 c664e7478108ab33303f49c88c953c0004c0399dbb95ef2a272724e2658d0167

See more details on using hashes here.

Provenance

The following attestation bundles were made for vbpca_py-0.3.0-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on yoavram-lab/VBPCApy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vbpca_py-0.3.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vbpca_py-0.3.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 95a5816a0e45cdacd04243c19ec83fdac4d8394bb79e08795e8b41dd84e21353
MD5 466d7fc87cfaabf428ad4ff76933972a
BLAKE2b-256 07982d75c8686ce625452176e8c6e3a244f85b88f53050f0d4dbdc69bb7a801f

See more details on using hashes here.

Provenance

The following attestation bundles were made for vbpca_py-0.3.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on yoavram-lab/VBPCApy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vbpca_py-0.3.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vbpca_py-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bd3d34930852e2fbb114efb15c5720d8cc61e9a363c74042a70006ef7de2b628
MD5 119aab891d6b8057f53aead92d387b23
BLAKE2b-256 dba7cccad27db3bd87aaa0b2439eba01c17066aaf65fe5ea088f246cd85d0f59

See more details on using hashes here.

Provenance

The following attestation bundles were made for vbpca_py-0.3.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on yoavram-lab/VBPCApy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.0 This release

10 files

0.2.0

10 files

0.1.1

10 files

0.1.0

10 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page