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), 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_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. 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 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, 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.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 plskit 0.7.0
File Size Uploaded
plskit-0.7.0.tar.gz 568.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for plskit 0.7.0
File Interpreter ABI Platform
plskit-0.7.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
plskit-0.7.0-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.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details

Total release size: 4.8 MB

Release files / plskit-0.7.0.tar.gz

Download URL plskit-0.7.0.tar.gz
Size 568.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fa20fb7354774a46b94ff50291c5aab5199c55dbdf6540ca4d3fc3cebf97db2e
BLAKE2b-256 checksum
How to use checksums
ecd1544a2f5bf303928689bc0ef4702a182bad0bb73ba81829a8ebec6b296807
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 11, 2026.

Transparency log

Release files / plskit-0.7.0-cp311-abi3-win_amd64.whl

Download URL plskit-0.7.0-cp311-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b0705af79b0ef1413528b077df35661dbae4e39879fffcda81ecf36b4deefd67
BLAKE2b-256 checksum
How to use checksums
3e242e9569280676556a9f38921a93ae1741ab7873688860b828868ebc7bf158
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 11, 2026.

Transparency log

Release files / plskit-0.7.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL plskit-0.7.0-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
2423c9f0bf29b892f1fc5833ddf834f3a6fc8388ad7e44d7c9ed9f74599487ab
BLAKE2b-256 checksum
How to use checksums
ae31ca55ac16b7576d0e9f6660370151cc486806dd4aab4c65fa02677194d2c1
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 11, 2026.

Transparency log

Release files / plskit-0.7.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL plskit-0.7.0-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
603073b661f20e42a4b1116abcb509aa2be17cc8921856154003705878ca18e5
BLAKE2b-256 checksum
How to use checksums
df78c0da9f69ea6defb9f873efa05487a695ea3d979fd9f9fdddb28fad0e45d3
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 11, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.1

4 release files

This release

0.7.0 This release

4 release files

0.6.1

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