plskit (Python)
Python package for plskit: Partial Least Squares with modern inference, backed by a Rust engine.
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.
Quickstart
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.
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.
Documentation
- Python API reference: every function.
- Results reference: every result type.
License
GPL-3.0-or-later.
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}
}
Paweł Lenartowicz — Freestyler Scientist · GitHub · ORCID
Metadata
Release files for plskit 0.7.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| plskit-0.7.2.tar.gz | 593.8 kB | With provenance | Details for plskit-0.7.2.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| plskit-0.7.2-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details for plskit-0.7.2-cp311-abi3-win_amd64.whl |
| plskit-0.7.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ x86-64 | Details for plskit-0.7.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| plskit-0.7.2-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details for plskit-0.7.2-cp311-abi3-macosx_11_0_arm64.whl |
Total release size: 4.9 MB
Release files / plskit-0.7.2.tar.gz
| Download URL | plskit-0.7.2.tar.gz |
|---|---|
| Size | 593.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4a4dbe5dc05b8d45040ddef86f0e2b274626e9ce1013e3768f4a026a1d9c7a1
|
|
BLAKE2b-256 checksum How to use checksums |
e303e10cd6c6237f597a2b4ff1c3753c7797d5df5df50bc3a28c6533a110e4e6
|
| 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 19, 2026.
Transparency logRelease files / plskit-0.7.2-cp311-abi3-win_amd64.whl
| Download URL | plskit-0.7.2-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b07af25af39a8c32d49a2f5c5dd8d4eb17c6413b76f53c7ade988a3e90723384
|
|
BLAKE2b-256 checksum How to use checksums |
45da8e3202e274113f3dd38c15f4d34d7e0a6d87504b8c4a30cffc8ace99bab2
|
| 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 19, 2026.
Transparency logRelease files / plskit-0.7.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | plskit-0.7.2-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 |
bcc5ea6afe94cb86adb904083aa073a6ef7de39e511cc70392638a5451984405
|
|
BLAKE2b-256 checksum How to use checksums |
d6f8ba25516938eb741eba6b5bab4edc4d88ed52a4b30bb0b756575109f973d7
|
| 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 19, 2026.
Transparency logRelease files / plskit-0.7.2-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | plskit-0.7.2-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 |
655f2063aa96ca6d03065b309f8a9087d79a878af145eeaa3e0719ddc33761b1
|
|
BLAKE2b-256 checksum How to use checksums |
30107e395ae162d451f7f3018bcea9f7d1c975efff7c80d7158257299864c3cc
|
| 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 19, 2026.
Transparency logSecurity for plskit 0.7.2
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.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for plskit-0.7.2.tar.gz
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 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.