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.

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

Lenartowicz, P., Plisiecki, H. (2026). Cheap Per-Component Testing for PLS, Stable Under Rotation (Under Review).

License

GPL-3.0-or-later.

Metadata

Release files for plskit 0.6.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.6.0
File Size Uploaded
plskit-0.6.0.tar.gz 483.7 kB Details

Built distributions (wheels)

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

Total release size: 4.1 MB

Release files / plskit-0.6.0.tar.gz

Download URL plskit-0.6.0.tar.gz
Size 483.7 kB
Tags Source
SHA-256 checksum
How to use checksums
aa723361927096b5d72226d50332d39ec612d3177207f5d30915dde595a97d7d
BLAKE2b-256 checksum
How to use checksums
46fa2abc12e3f490db77ea0c49fd2bd4e0859283913860b3de9cd684a25cc914
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 27, 2026.

Transparency log

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

Download URL plskit-0.6.0-cp310-abi3-win_amd64.whl
Size 1.3 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d3437bae937bbbdef4366c6b396cc924b9a775cfc5eab38c74f1b7a64bc34bd5
BLAKE2b-256 checksum
How to use checksums
9ef97234a4c87b8877a6294a09f7611784403e4c610ccc593e6ead136eb04e42
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 27, 2026.

Transparency log

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

Download URL plskit-0.6.0-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
39925aeac645f342673d45a50c2a4c89b21e31b6e56b7a928a1ffce4c0802b6f
BLAKE2b-256 checksum
How to use checksums
1bbb6ca7cab18104b16172dbbd36590330d688c4de113425ddfae0a9274b8b52
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 27, 2026.

Transparency log

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

Download URL plskit-0.6.0-cp310-abi3-macosx_11_0_arm64.whl
Size 909.8 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ce62bcc69ca1754edeea00b0b32526c8fb7b2f64f6c6457e44cbc6e5e7cd6098
BLAKE2b-256 checksum
How to use checksums
0acea4f2012abc5805cc9913ee1223d2a60bf37f44819057ec80771027bfc48a
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 27, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.1

4 release files

0.7.0

4 release files

0.6.1

4 release files

This release

0.6.0 This release

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