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

Uploaded CPython 3.10+Windows x86-64

plskit-0.2.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.2.0-cp310-abi3-macosx_11_0_arm64.whl (826.4 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: plskit-0.2.0.tar.gz
  • Upload date:
  • Size: 170.5 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.0.tar.gz
Algorithm Hash digest
SHA256 8265956606532fd84be94f997ae53b4efdb0ddd98f9505821338d2fd76e869a7
MD5 d1ce9044ae338640e361f14b5a0838df
BLAKE2b-256 6872fd8aa9c38e577767cc6859374a08e97586a44ad5e36d0c74940768f1e726

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: plskit-0.2.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.2.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 35e68fbe3dd1e407ff420a38931f8029d790a1aca13d63c8face8183e8e2d831
MD5 a8c53a6086a63ec8014108d9cc4d5142
BLAKE2b-256 783efa5590d3e5a3efbd1e7bcd6cb80f3c26d53ef75ba2657774576953698c0c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for plskit-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5b35d4e685c1f3da51e8f8622ff0c7fa2d791ff91932c97e338bc5550f367842
MD5 38874835415c2e6604edb592fa1b7f53
BLAKE2b-256 5c60ccc03e2dea444330ceb7f24023d9b331c5b9208d6c2299bab19e7e0eeccd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for plskit-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1df6ddddf9802263ebfb25dbad1bd5060d23837afb5e5dd1662cd393c7d2895d
MD5 5d630810ad35648bfaa3d5607405999f
BLAKE2b-256 ee5cd72e110300c141b50a89f7d8b80504fb62f7e544b10dd1ee20947172010f

See more details on using hashes here.

Provenance

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