plskit (Python)
Python wrapper for plskit: Partial Least Squares with modern
inference (split_exact and split_nb tests, rotation-invariant
subsampling CIs), backed
by a Rust engine.
Part of the plskit project: the Rust core, sibling wrappers (R and Julia), shared test corpus, issues, and PRs all live there.
What is plskit?
plskit is a Partial Least Squares (PLS) library built around four ideas:
- Modern inference. Confirmatory tests use split-half held-out
prediction:
split_exactis calibrated by permutation, andsplit_nbis its faster Fisher-z approximation. Confidence intervals are taken on rotation-invariant quantities (held-out correlation, per-variable leverage, a subsampling z for β), so no Procrustes alignment is needed. The tests are introduced in our NeurIPS 2026 paper. - Same results in every language. All numerical work runs in one
Rust engine. The Python and R wrappers call into it, and the Julia
wrapper runs the Python package, so a fixed
(version, seed, X, y)gives the same results, within a bit-near tolerance, in every language and on every supported platform. - Speed. The engine is written in Rust and fits PLS1 with Improved Kernel PLS (Dayal and MacGregor 1997), which makes plskit probably the fastest PLS package on a single core.
- Parallel and RAM-safe. Inference runs efficiently in parallel without blowing up RAM.
Install
pip install plskit
Wheels are built for Linux, macOS, and Windows on recent Python
versions (>=3.11). When a wheel is unavailable for your platform,
pip falls back to building from the source distribution, which
requires a working Rust toolchain.
A 60-second look
import numpy as np
import plskit
X = np.random.default_rng(0).normal(size=(200, 20))
y = X[:, :3].sum(axis=1) + np.random.default_rng(1).normal(size=200)
# Fit at fixed K, or let plskit pick K via cross-validation.
model = plskit.pls1_fit(X, y, k=3, seed=42)
optimal = plskit.pls1_fit(X, y, k="optimal", k_max=10, seed=42)
y_hat = plskit.pls1_predict(model, X_new=X[:5])
# Confirmatory test for any signal; k=1 with split_exact is recommended.
sig = plskit.pls1_confirmatory_test(
X, y, k=1, test_method="split_exact", seed=42,
)
print(sig.pvalue, sig.statistic)
Public surface
Three model families: PLS1 (single continuous y), sparse PLS1, and
PLS3 / PLSSVD (symmetric X/Y covariance analysis) with a sparse
variant. PLS2 and multi-block PLS are planned.
- Preprocessing:
preprocess. - PLS1 fit / predict:
pls1_fit,pls1_predict; K-selection viapls1_find_k_optimal,pls1_find_k_sequence. - Sparse PLS1:
spls1_fit,spls1_find_keep_optimal,spls1_find_k_optimal,spls1_find_k_sequence(predict withpls1_predict). - PLS3 / PLSSVD:
pls3_fit(aliasplssvd_fit),pls3_transform(aliasplssvd_transform), sparsespls3_fit(new in 0.6.0). - Inference:
pls1_confirmatory_test,pls3_confirmatory_test,split_nb_gate,pls1_perm_null,pls1_perm_alpha. - Interpretive:
rotate,pls1_rotation_stability.
The Python API reference documents every function, and the results reference every result type. Results are frozen dataclasses and carry the inputs and seed that produced them.
Errors raised by the Rust engine surface as plskit.PlsKitError
(with PlsKitInvalidWeights and PlsKitResamplingDegenerate
subclasses) and carry a stable .code for programmatic handling.
This is a thin wrapper
All numerical work runs inside the plskit Rust crate. The Python
package converts inputs to f64, calls the engine, and wraps the
result. Bug reports and feature requests belong on the
monorepo issue tracker.
Citation
@inproceedings{lenartowicz2026cheap,
title = {Cheap and Powerful Tests for Supervised Subspaces: Per-Component Inference for {PLS}},
author = {Lenartowicz, Pawe{\l} and Plisiecki, Hubert},
booktitle = {The Fortieth Annual Conference on Neural Information Processing Systems},
year = {2026},
url = {https://openreview.net/forum?id=xb6CB7d9LO}
}
License
GPL-3.0-or-later.
Metadata
Release files for plskit 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| plskit-0.7.1.tar.gz | 596.2 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| plskit-0.7.1-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details |
| plskit-0.7.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| plskit-0.7.1-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 4.9 MB
Release files / plskit-0.7.1.tar.gz
| Download URL | plskit-0.7.1.tar.gz |
|---|---|
| Size | 596.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d8e65aa58e9d0811bb41d63e57d45e93b2b4e1686ca4d9263c1ad28808dc03e
|
|
BLAKE2b-256 checksum How to use checksums |
1929e0158df19290628b144077ce074f588093c141dc5813376f9cc9e94f8eaf
|
| 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 16, 2026.
Transparency logRelease files / plskit-0.7.1-cp311-abi3-win_amd64.whl
| Download URL | plskit-0.7.1-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5d3483cd4fde3fcc8c2a26bf6f5c2333a8755b73acafa83a2d5ddf06ce9bf9b0
|
|
BLAKE2b-256 checksum How to use checksums |
417817ea5cdfb5dfd39773a0dc5f54d8779268a08036b902f1b0439b4d22cfe3
|
| 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 16, 2026.
Transparency logRelease files / plskit-0.7.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | plskit-0.7.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
d5b60ef682fa1be099370fabfc38b9c7224af034bd020d56da2232e2f563adc6
|
|
BLAKE2b-256 checksum How to use checksums |
6fa83614a86691320b74963669d8a190fe1a28305181f6519717f8d7a4165481
|
| 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 16, 2026.
Transparency logRelease files / plskit-0.7.1-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | plskit-0.7.1-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
664a11a70e6f306f5e2feeb3743232c7199b784035282f69fdb669d00dfc6bef
|
|
BLAKE2b-256 checksum How to use checksums |
4895553b677f93a372a0aaa7744274436b96cda80ebde536c53e57a4dc5e98c5
|
| 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 16, 2026.
Transparency log