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

Uploaded CPython 3.10+Windows x86-64

plskit-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

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

plskit-0.1.0-cp310-abi3-macosx_11_0_arm64.whl (805.1 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for plskit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dc2a309ae0989526a2b32d50fe80be295e5c7e457eea40bde4d82ba704ec15ef
MD5 7aebb2c54f893f833b3c230ab5df2b68
BLAKE2b-256 a71216f02342ed39dfd2a849bb46120dea6534d57f7ba6978e8dd9909f7d011d

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for plskit-0.1.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 124ccda86636e6b68023f0ba097953bd1fecc17bc57a2a4ac0331a7250ab51a1
MD5 352d5f11e4761183238dba0cb0f642be
BLAKE2b-256 dd154efb68e051f0ea8ad10dab407ba560106e3e5f098ee49581f93006c0ab49

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for plskit-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c6d891aad58c580e89b2cc6d85c9900944428b8df6a280a66b311d6cf36c3ec9
MD5 9e621727c02111bf1236cf1f8a61b3a5
BLAKE2b-256 1c1f78d73fd39c603bc7e17b7be857aaabb123922bdd4744e35ec7f00cf0b4e1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for plskit-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 da5d0f4ce2fab16b400c312760030590537348de3e47a63c75931cff80289b7c
MD5 dcf20845f55d93fa485a8ff0a83cb017
BLAKE2b-256 9b9a2e48a7b1ac87ce54adc01e86eb74a5fb3e6f1f727eb8bbb7bf6292fd1f89

See more details on using hashes here.

Provenance

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

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