Skip to main content

PLS regression with modern inference (Python wrapper for plskit).

Project description

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.

Project details


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.2.1.tar.gz (172.4 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.2.1-cp310-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

plskit-0.2.1-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.2.1-cp310-abi3-macosx_11_0_arm64.whl (826.6 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: plskit-0.2.1.tar.gz
  • Upload date:
  • Size: 172.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for plskit-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9c94555ed3f1252a7347119c283ec532b7dd94339039005e34425f7f69d1872e
MD5 60f871ba5e0566d2eff81910bbfe0b72
BLAKE2b-256 a3743364329835e90d7d0197421df0e7792555647672fa7341b901a8d1cc4ef8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: plskit-0.2.1-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/6.1.0 CPython/3.13.12

File hashes

Hashes for plskit-0.2.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 df1d9e537bfef44d1c0d3db4f008c804ee49f7f1267786812686eba3911d290c
MD5 b1271ad352da01a107aee1565003e6d8
BLAKE2b-256 1687b4a730923d660a5cad70e10e66f7a52db999423fed78cb1f70d07afba4f2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for plskit-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 088d09490d0c452dda13205c7700a02b968644762c028f05ba09c68e72ec744a
MD5 1b24c85ae25e7cb6dac866e33fff9937
BLAKE2b-256 b085d44d01267eeec61e768eeeabb6c306d032d51f30f1cdc6d2921d906f8b8a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for plskit-0.2.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a01d8e94df22fa4f7ca2211e198fc685593b0db97700d8c84610f5d304257614
MD5 1f1e3702c910d3e8b99ac36695c216aa
BLAKE2b-256 6be81344762a8e5c64f34d2efc0e79b689f692f0ab76ad13d7c03a36f40a7bc3

See more details on using hashes here.

Provenance

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page