Skip to main content

plskit (Python)

PyPI Python versions License: GPL-3.0-or-later

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, planned), shared test corpus, issues, and PRs all live there.

What is plskit?

plskit is a Partial Least Squares (PLS) library built around three ideas:

  • Modern inference. Confirmatory tests use split-half held-out prediction: split_exact is calibrated by permutation, and split_nb is 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. Python (and the planned R and Julia wrappers) call into it, 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 with parallel resampling, which makes plskit probably the fastest PLS package available.

Install

pip install plskit

Wheels are built for Linux, macOS, and Windows on recent Python versions (>=3.10). 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, 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 via pls1_find_k_optimal, pls1_find_k_sequence.
  • Sparse PLS1: spls1_fit, spls1_find_keep_optimal, spls1_find_k_optimal, spls1_find_k_sequence (predict with pls1_predict).
  • PLS3 / PLSSVD: pls3_fit (alias plssvd_fit), pls3_transform (alias plssvd_transform), sparse spls3_fit (new in 0.6.0).
  • Inference: pls1_confirmatory_test, pls3_confirmatory_test, split_nb_gate, pls1_perm_null.
  • 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.6.1

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

Source distribution (sdist)

Source distribution for plskit 0.6.1
File Size Uploaded
plskit-0.6.1.tar.gz 494.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for plskit 0.6.1
File Interpreter ABI Platform
plskit-0.6.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
plskit-0.6.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
plskit-0.6.1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 4.2 MB

Release files / plskit-0.6.1.tar.gz

Download URL plskit-0.6.1.tar.gz
Size 494.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f3667cc32b72e13a79a24eabc5e93bb0d17840e4b826f159662543979e7b0019
BLAKE2b-256 checksum
How to use checksums
aeac911883dfc283e57ca5217e597508a2fe58a27c024787bf9f01aa99005ba0
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 Sep 29, 2026.

Transparency log

Release files / plskit-0.6.1-cp310-abi3-win_amd64.whl

Download URL plskit-0.6.1-cp310-abi3-win_amd64.whl
Size 1.3 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0ff40b8115f67ad9e38cb9f8a9f2cd4879c90d4aa413de527420c3735c82a2d9
BLAKE2b-256 checksum
How to use checksums
cd43eb2c3308c8c6bf28e4d6bf001b4077c2bc1d0a1d62669140174ece438d6e
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 Sep 29, 2026.

Transparency log

Release files / plskit-0.6.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL plskit-0.6.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
fd8de366371b77418e4338b811049bfb89379cdcabbbf47519c7cdb979a21aba
BLAKE2b-256 checksum
How to use checksums
c6d37e0d64a99a8650beff16b09999b1b44333827287420e5bbadacd9f2fec29
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 Sep 29, 2026.

Transparency log

Release files / plskit-0.6.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL plskit-0.6.1-cp310-abi3-macosx_11_0_arm64.whl
Size 923.1 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
35ccaea712bc2fb38a9b7ec2fd91accb16389ebe4f1300eb7302f67cbc1f933d
BLAKE2b-256 checksum
How to use checksums
3dcf2a77df076635e18c72286607f23f59c47b59ebdf249e15bf7e983d4bfbb2
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 Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.1

4 release files

0.7.0

4 release files

This release

0.6.1 This release

4 release files

0.6.0

4 release files

0.5.0

4 release files

0.4.0

4 release files

0.3.0

4 release files

0.2.1

4 release files

0.2.0

4 release files

0.1.0

4 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