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 (canonical percentile CIs, split_perm, split_nb), 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 at the pre-specified K.
sig = plskit.pls1_confirmatory_test(
    X, y, k=3,
    method="split_nb", args={"n_splits": 50}, seed=42,
)
print(sig.pvalue, sig.statistic)

PLS1 (single continuous y) is the only family available in v0.1; PLS2, PLS3 / PLSSVD, and multi-block follow.

Public surface

Functions: preprocess, pls1_fit, pls1_predict, pls1_confirmatory_test, pls1_find_k_optimal, pls1_find_k_sequence, pls1_perm_null, pls1_rotation_stability, rotate.

Result types: PreprocessResult, PLS1Result, ConfirmatoryTestResult, FindKOptimalResult, FindKSequenceResult, PermNullResult, RotationStabilityResult, RotateResult, RotationSpec, CIScalar, ConfirmatoryCI. All 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plskit-0.3.0.tar.gz (180.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

plskit-0.3.0-cp310-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

plskit-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

plskit-0.3.0-cp310-abi3-macosx_11_0_arm64.whl (824.0 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file plskit-0.3.0.tar.gz.

File metadata

  • Download URL: plskit-0.3.0.tar.gz
  • Upload date:
  • Size: 180.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for plskit-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fe81064c3f1646f62c4233b0a98b48a95844aec40773e0942a2010e619242af1
MD5 c9fa464a938c01904171fa3d7b7727af
BLAKE2b-256 7c82f8671041b61ba7fc0a2a7ea6b020dca5e00bc9d618f7e702e86cc75690e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for plskit-0.3.0.tar.gz:

Publisher: release.yml on pawlenartowicz/plskit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file plskit-0.3.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: plskit-0.3.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for plskit-0.3.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e1850c41822b592541e58ea8a526f5b0e90c67e9991b18358092ad8a8cd11dd8
MD5 e45a9be8c2201b07ed84d00702ccf353
BLAKE2b-256 c067ea5884aba43f1ac6c3189ba9f0fdb2ed92d904ead0ad15dd791706dbb217

See more details on using hashes here.

Provenance

The following attestation bundles were made for plskit-0.3.0-cp310-abi3-win_amd64.whl:

Publisher: release.yml on pawlenartowicz/plskit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file plskit-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for plskit-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9803dce210afde6c242519651103b450fe55a62915ca5ddf8141823aaf1efcfe
MD5 69b93463a865e893a19f644c66b82f4e
BLAKE2b-256 049ac269ee82ad460265d65996a0c49ba5b92f560d2cae658d4f5d05637297f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for plskit-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on pawlenartowicz/plskit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file plskit-0.3.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for plskit-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aa282f57df818299d1a0153cd1c01ff2226dc818e4426f06bea42e7eb4ce05a3
MD5 e9274881cc3ba3a43464b24696b61a7e
BLAKE2b-256 2444b1d862271c25ea5e9af3c714a556e07d17fd2cd8254f2d9e9b4e4f35022f

See more details on using hashes here.

Provenance

The following attestation bundles were made for plskit-0.3.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on pawlenartowicz/plskit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.0

4 files

This release

0.3.0 This release

4 files

0.2.1

4 files

0.2.0

4 files

0.1.0

4 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