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_exact, 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.4.0.tar.gz (202.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.4.0-cp310-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10+Windows x86-64

plskit-0.4.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.4.0-cp310-abi3-macosx_11_0_arm64.whl (874.6 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: plskit-0.4.0.tar.gz
  • Upload date:
  • Size: 202.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.4.0.tar.gz
Algorithm Hash digest
SHA256 d4282be0f5469cfa9cdbe77fe1fe99b8ee5a3711e5032e6a4f3ee547162c85d7
MD5 4a1a6bee8557fdd540a7a7e6e5ff94cc
BLAKE2b-256 eef57109bac1720a0441df1f6c0e58ee1e2abe8abd0e6b780deab2079b81e681

See more details on using hashes here.

Provenance

The following attestation bundles were made for plskit-0.4.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.4.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: plskit-0.4.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.2 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.4.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d7783b217d129f6ee1f16043a7ea759ebf079e6a84cafd5da498a8514cafe07d
MD5 eea0a02d80aa9775bfa560a5f95c7de6
BLAKE2b-256 7621fbec62ce5c78a51ca83f75a17305396d685adbc4f77215a9b5bb49819405

See more details on using hashes here.

Provenance

The following attestation bundles were made for plskit-0.4.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.4.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for plskit-0.4.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6bb8c9c7646d7267dd7edd40e77de554ade14f12c238f46fb38776508b7f8aa3
MD5 2ea9ee897c84a6afa29c5805612238e8
BLAKE2b-256 49bc7237e2a9ee525cbb0999e13db4aaede89daef5ab947b05ce5e0f7e11ea0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for plskit-0.4.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.4.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for plskit-0.4.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc7912e6f5dbaeb36dcb2b42a4fa9c2b540e732f890cb47fe8807703fe259e07
MD5 4bee8e5ce256af841b226d9a812d3dae
BLAKE2b-256 bbda642b125b1dcd004d19bcebbfd452942754bb4701892b04d88dab7faa9bfd

See more details on using hashes here.

Provenance

The following attestation bundles were made for plskit-0.4.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

This release

0.4.0 This release

4 files

0.3.0

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