VBPCApy
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_componentsandcross_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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2966c576b059a2c09803da161211e04a316f4babc3668e02f0e78de59854bcd
|
|
| MD5 |
807966b4a7378e2f43313deb2539f47b
|
|
| BLAKE2b-256 |
0e468e147a76a54c424c681d63f82639a4d9e135221a8f643e0882fafb43ce47
|
Provenance
The following attestation bundles were made for vbpca_py-0.3.0.tar.gz:
Publisher:
publish.yml on yoavram-lab/VBPCApy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vbpca_py-0.3.0.tar.gz -
Subject digest:
c2966c576b059a2c09803da161211e04a316f4babc3668e02f0e78de59854bcd - Sigstore transparency entry: 2498433237
- Sigstore integration time:
-
Permalink:
yoavram-lab/VBPCApy@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yoavram-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34b65ee95af81977fabb80ea08a36c5c9bb2d9f0adc54fc29e80983932c98338
|
|
| MD5 |
af52b6f2d4fc9c5eed28522427cc260f
|
|
| BLAKE2b-256 |
13f3dc86fbcd72d6e923cdd4b24875fd65f9e97712c4f4d23fe7f7c31c124ade
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vbpca_py-0.3.0-cp313-cp313-win_amd64.whl -
Subject digest:
34b65ee95af81977fabb80ea08a36c5c9bb2d9f0adc54fc29e80983932c98338 - Sigstore transparency entry: 2498433342
- Sigstore integration time:
-
Permalink:
yoavram-lab/VBPCApy@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yoavram-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Trigger Event:
release
-
Statement type:
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
- Download URL: vbpca_py-0.3.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 11.7 MB
- Tags: CPython 3.13, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f33176649471df1da93d45550d0bc316978659fea7f1bbf8f8ee3d3fbd0daa1
|
|
| MD5 |
1c1494396397502521fb98d97a1d8c92
|
|
| BLAKE2b-256 |
a3f65c26367ca56fec55019712e348026af32f8ac4f29ec22e83a1ebc345dd74
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vbpca_py-0.3.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
5f33176649471df1da93d45550d0bc316978659fea7f1bbf8f8ee3d3fbd0daa1 - Sigstore transparency entry: 2498433317
- Sigstore integration time:
-
Permalink:
yoavram-lab/VBPCApy@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yoavram-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vbpca_py-0.3.0-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: vbpca_py-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 774.0 kB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a94daebf860b4d8901c9cf49f492f520c02c47491a77aabed75a52fe2345a52e
|
|
| MD5 |
63153646347cd57249ee02501aee46a1
|
|
| BLAKE2b-256 |
e1038ee6f76524257a706b8324e35075604c33dafd6fda1c6ad0e6522a4d6e8e
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vbpca_py-0.3.0-cp313-cp313-macosx_11_0_arm64.whl -
Subject digest:
a94daebf860b4d8901c9cf49f492f520c02c47491a77aabed75a52fe2345a52e - Sigstore transparency entry: 2498433251
- Sigstore integration time:
-
Permalink:
yoavram-lab/VBPCApy@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yoavram-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0db7ddcefba294bae3dd40b2dc9b84cbfe66956b10098145125ec767cad2afb7
|
|
| MD5 |
5009425efeaf869132b79ada93839547
|
|
| BLAKE2b-256 |
e2c74eb1b921574627ae5d2bcd0bf709c404abeec1800cbda48e93e36aa193ad
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vbpca_py-0.3.0-cp312-cp312-win_amd64.whl -
Subject digest:
0db7ddcefba294bae3dd40b2dc9b84cbfe66956b10098145125ec767cad2afb7 - Sigstore transparency entry: 2498433303
- Sigstore integration time:
-
Permalink:
yoavram-lab/VBPCApy@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yoavram-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Trigger Event:
release
-
Statement type:
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
- Download URL: vbpca_py-0.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 11.7 MB
- Tags: CPython 3.12, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df68a89f31631de555b1c731285e132015f00cf9066303122f4f775581bcb188
|
|
| MD5 |
7e9751779ebb65463afc046bf14b89ad
|
|
| BLAKE2b-256 |
611c79c43695790af375f299ba88fea5bce7fb363df5e658a355d382a5333fa4
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vbpca_py-0.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
df68a89f31631de555b1c731285e132015f00cf9066303122f4f775581bcb188 - Sigstore transparency entry: 2498433333
- Sigstore integration time:
-
Permalink:
yoavram-lab/VBPCApy@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yoavram-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vbpca_py-0.3.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: vbpca_py-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 773.8 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7f53585d28d2a4b4d8f60756efdf0066ef07e039229d84c225ee0f90462c6e7
|
|
| MD5 |
acf3d67e9b4096f4772d146c652fff6d
|
|
| BLAKE2b-256 |
e7786d1fc2ddd09e0ca3cabb44c5c0758e96c8232df13b4d518fd3b843999857
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vbpca_py-0.3.0-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
c7f53585d28d2a4b4d8f60756efdf0066ef07e039229d84c225ee0f90462c6e7 - Sigstore transparency entry: 2498433277
- Sigstore integration time:
-
Permalink:
yoavram-lab/VBPCApy@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yoavram-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
585c09dca92f53c761b808776f97335ca98d6be06f53c7490dd1da4f98bdc349
|
|
| MD5 |
620b0347e18d3e1ff0ca23cc3ec326a0
|
|
| BLAKE2b-256 |
c664e7478108ab33303f49c88c953c0004c0399dbb95ef2a272724e2658d0167
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vbpca_py-0.3.0-cp311-cp311-win_amd64.whl -
Subject digest:
585c09dca92f53c761b808776f97335ca98d6be06f53c7490dd1da4f98bdc349 - Sigstore transparency entry: 2498433266
- Sigstore integration time:
-
Permalink:
yoavram-lab/VBPCApy@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yoavram-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Trigger Event:
release
-
Statement type:
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
- Download URL: vbpca_py-0.3.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 11.6 MB
- Tags: CPython 3.11, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95a5816a0e45cdacd04243c19ec83fdac4d8394bb79e08795e8b41dd84e21353
|
|
| MD5 |
466d7fc87cfaabf428ad4ff76933972a
|
|
| BLAKE2b-256 |
07982d75c8686ce625452176e8c6e3a244f85b88f53050f0d4dbdc69bb7a801f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vbpca_py-0.3.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
95a5816a0e45cdacd04243c19ec83fdac4d8394bb79e08795e8b41dd84e21353 - Sigstore transparency entry: 2498433294
- Sigstore integration time:
-
Permalink:
yoavram-lab/VBPCApy@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yoavram-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vbpca_py-0.3.0-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: vbpca_py-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 758.0 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd3d34930852e2fbb114efb15c5720d8cc61e9a363c74042a70006ef7de2b628
|
|
| MD5 |
119aab891d6b8057f53aead92d387b23
|
|
| BLAKE2b-256 |
dba7cccad27db3bd87aaa0b2439eba01c17066aaf65fe5ea088f246cd85d0f59
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vbpca_py-0.3.0-cp311-cp311-macosx_11_0_arm64.whl -
Subject digest:
bd3d34930852e2fbb114efb15c5720d8cc61e9a363c74042a70006ef7de2b628 - Sigstore transparency entry: 2498433284
- Sigstore integration time:
-
Permalink:
yoavram-lab/VBPCApy@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yoavram-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9b4db1fb5ad46b6202fd1ece8ee5f6d2c8932ab9 -
Trigger Event:
release
-
Statement type: