Skip to main content

rustypca

A Python library for Probabilistic PCA that handles missing data without asking you to impute first. It uses the EM algorithm under the hood, with the number-crunching done in Rust.

Why?

Regular PCA doesn't cope well when your data has holes in it. Probabilistic PCA treats missing values as latent variables in a generative model — a more principled approach than patching NaNs and hoping for the best.

For the full story, see Tipping & Bishop (1999), "Probabilistic Principal Component Analysis", Journal of the Royal Statistical Society, 61(3), 611–622.

Features

  • Rust backend — keeps things snappy on larger datasets
  • Missing value support — the main reason this exists
  • Scikit-learn compatible — fits in wherever you'd use sklearn.decomposition.PCA

Installation

pip install rustypca

You'll need a Rust toolchain to build from source. Python >= 3.10.

Quick start

import numpy as np
from rustypca import PPCA

X = np.random.randn(100, 10)
X[np.random.rand(100, 10) < 0.1] = np.nan  # Introduce some missing values

model = PPCA(n_components=2)
X_transformed = model.fit_transform(X)
X_reconstructed = model.inverse_transform(X_transformed)

No preprocessing or imputation needed.

Testing

make test

Disclaimer

This project was built with the help of Claude.

License

MIT

Metadata

Release files for rustypca 0.2.0

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

Source distribution (sdist)

Source distribution for rustypca 0.2.0
File Size Uploaded
rustypca-0.2.0.tar.gz 176.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for rustypca 0.2.0
File
rustypca-0.2.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
rustypca-0.2.0-cp313-cp313-manylinux_2_35_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.35+ x86-64 Details
rustypca-0.2.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
rustypca-0.2.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
rustypca-0.2.0-cp312-cp312-manylinux_2_35_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.35+ x86-64 Details
rustypca-0.2.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
rustypca-0.2.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
rustypca-0.2.0-cp311-cp311-manylinux_2_35_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.35+ x86-64 Details
rustypca-0.2.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
rustypca-0.2.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
rustypca-0.2.0-cp310-cp310-manylinux_2_35_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.35+ x86-64 Details
rustypca-0.2.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 4.5 MB

Release files / rustypca-0.2.0.tar.gz

Download URL rustypca-0.2.0.tar.gz
Size 176.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fd162fb9ef9827840be138114be59f55e2a9f1430f0b22e3bb91ab77641d5b3a
BLAKE2b-256 checksum
How to use checksums
f8b3df80a9bcc9c7fa14beb67a1871da9913da5a5523b5866fa8405745b0a06a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Apr 10, 2026.

Transparency log

Release files / rustypca-0.2.0-cp313-cp313-win_amd64.whl

Download URL rustypca-0.2.0-cp313-cp313-win_amd64.whl
Size 279.8 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
cd711e6a6e761c803f994c11170737f2f40df236a12b0fd1acd7e76d97e1fb51
BLAKE2b-256 checksum
How to use checksums
3ac76ad4e1f9d0e8dfe123c0aefda709cf360fc02aecea8a02a43cc4c2640a6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Apr 10, 2026.

Transparency log

Release files / rustypca-0.2.0-cp313-cp313-manylinux_2_35_x86_64.whl

Download URL rustypca-0.2.0-cp313-cp313-manylinux_2_35_x86_64.whl
Size 424.7 kB
Tags CPython 3.13 Linux glibc 2.35+ x86-64
SHA-256 checksum
How to use checksums
d95553284a5708baea10ceba09ff4248454b936ab11365b71788a171d8012a1c
BLAKE2b-256 checksum
How to use checksums
9c3ec119e183ac91a064a6f634733e992719e6f8ffd35403bdc8dfe79c758fe5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Apr 10, 2026.

Transparency log

Release files / rustypca-0.2.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL rustypca-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Size 363.7 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ebf73b5959508013dafd10254a2d910f7b8f57ed9333b26ee7de49ffe48d4d83
BLAKE2b-256 checksum
How to use checksums
4f1157d2169df527f18cae8ceb855c8b96f2cccf1fcfe8013d74d2f88a31ac17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Apr 10, 2026.

Transparency log

Release files / rustypca-0.2.0-cp312-cp312-win_amd64.whl

Download URL rustypca-0.2.0-cp312-cp312-win_amd64.whl
Size 279.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
436c31ed6fdf2f4139b93b5402d0ba63e35c01bb335d809cdc6844794117ce4b
BLAKE2b-256 checksum
How to use checksums
a1489e0fe397641152aa627ac271d201a78846ede2cf88d9a952b0c6c8b2d553
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Apr 10, 2026.

Transparency log

Release files / rustypca-0.2.0-cp312-cp312-manylinux_2_35_x86_64.whl

Download URL rustypca-0.2.0-cp312-cp312-manylinux_2_35_x86_64.whl
Size 424.9 kB
Tags CPython 3.12 Linux glibc 2.35+ x86-64
SHA-256 checksum
How to use checksums
8414397932a6f27b8c5a9b3c9371106cbe961f6c7378b515604681d1eaa41b97
BLAKE2b-256 checksum
How to use checksums
7673c999f19269cb59191d4d3b25bb455d2aaa0db19cf4f4bcc7c4d0f5c156c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Apr 10, 2026.

Transparency log

Release files / rustypca-0.2.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL rustypca-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Size 363.8 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5bede10768b933996a0e19d9714aae9005debebd28e2c840bc76e8dc268a7a95
BLAKE2b-256 checksum
How to use checksums
fd9d4613cefde6d908e695678930ad5bb7cde5a44a2837cc7f275cf6ade69800
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Apr 10, 2026.

Transparency log

Release files / rustypca-0.2.0-cp311-cp311-win_amd64.whl

Download URL rustypca-0.2.0-cp311-cp311-win_amd64.whl
Size 279.5 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
6400cd3c44fff15800efb97defd11c2e6dc44192b15a9f171eadcbd904b2aaa7
BLAKE2b-256 checksum
How to use checksums
04de358b636a4eddcc474adad5f3f9a16352ff12b02152e22f1684a0d8fdfd7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Apr 10, 2026.

Transparency log

Release files / rustypca-0.2.0-cp311-cp311-manylinux_2_35_x86_64.whl

Download URL rustypca-0.2.0-cp311-cp311-manylinux_2_35_x86_64.whl
Size 425.4 kB
Tags CPython 3.11 Linux glibc 2.35+ x86-64
SHA-256 checksum
How to use checksums
a0cce6ba4137bc6f883966bc5a33e984ba82baed8aaa0055333b0ded0ad98cca
BLAKE2b-256 checksum
How to use checksums
a70cd4363dd30271ff4f412cb06d8373a7d4b988fa48e00f563ac644e1e80d0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Apr 10, 2026.

Transparency log

Release files / rustypca-0.2.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL rustypca-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Size 366.9 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6718bb1c8715c663274458b9b20fe62a99c6e211264bd98d64969b06b5dfca93
BLAKE2b-256 checksum
How to use checksums
23a84ff6ab79f99adb1f924e4d5a395f3b853ce7e808ebfbd2169a06c3119b0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Apr 10, 2026.

Transparency log

Release files / rustypca-0.2.0-cp310-cp310-win_amd64.whl

Download URL rustypca-0.2.0-cp310-cp310-win_amd64.whl
Size 279.7 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
b0dbdb8034de3a0004098a4d0538352f9648c9ee3180e5b159518c1a49a84f7e
BLAKE2b-256 checksum
How to use checksums
50af466ea11c519bfa6424673d8e7fb9e1114e4826b535146e906546f8b03106
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Apr 10, 2026.

Transparency log

Release files / rustypca-0.2.0-cp310-cp310-manylinux_2_35_x86_64.whl

Download URL rustypca-0.2.0-cp310-cp310-manylinux_2_35_x86_64.whl
Size 425.8 kB
Tags CPython 3.10 Linux glibc 2.35+ x86-64
SHA-256 checksum
How to use checksums
061599859804969ad74c8207a30a35ac3e6c8413cfa2178b8e2b324507515e8f
BLAKE2b-256 checksum
How to use checksums
35db540eee90dada29fef24cdfc4d189e4a3ed40cf1535222a849134675a50e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Apr 10, 2026.

Transparency log

Release files / rustypca-0.2.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL rustypca-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Size 367.0 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
73bd8179a0492a05e67e73d4a582a478c323304d12bc761d0768023ce6c639d0
BLAKE2b-256 checksum
How to use checksums
898d4534b658c4dfd594a48c8bebc8a1e73eb11bef5c309e641a83a41ca8cea8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Apr 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

13 release files

0.1.1

13 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