Skip to main content

Crate plskit

Crate plskit 

Source
Expand description

plskit — PLS regression with modern inference.

Single Rust crate; the same engine is consumed by the Python, R, and Julia wrappers (which call into this crate through their respective FFI layers).

Re-exports§

pub use error::PlsKitError;
pub use error::PlsKitResult;
pub use find_k::pls1_find_k_optimal;
pub use find_k::pls1_find_k_sequence;
pub use find_k::FindKOptimalOpts;
pub use find_k::FindKOptimalOutput;
pub use find_k::FindKSequenceOpts;
pub use find_k::FindKSequenceOutput;
pub use find_k::Selector;
pub use fit::pls1_fit;
pub use fit::FitOpts;
pub use fit::KSpec;
pub use fit::Pls1Model;
pub use perm_null::pls1_perm_null;
pub use perm_null::PermNullOpts;
pub use perm_null::PermNullOutput;
pub use predict::pls1_predict;
pub use preprocess::preprocess;
pub use preprocess::PreprocessInput;
pub use preprocess::PreprocessResult;
pub use rotate::rotate;
pub use rotate::RotateOutput;
pub use rotate::RotationMethod;
pub use rotate::VarimaxArgs;
pub use rotation_stability::pls1_rotation_stability;
pub use rotation_stability::RotationStabilityMethod;
pub use rotation_stability::RotationStabilityOpts;
pub use rotation_stability::RotationStabilityOutput;
pub use signal_test::pls1_confirmatory_test;
pub use signal_test::CIOpts;
pub use signal_test::ConfirmatoryArgs;
pub use signal_test::ConfirmatoryMethod;
pub use signal_test::ConfirmatoryTestInput;
pub use signal_test::ConfirmatoryTestOpts;
pub use signal_test::ConfirmatoryTestOutput;

Modules§

error
Error types for plskit. Error type for plskit. All public functions return PlsKitResult.
find_k
K selection (CV / BIC / sequence). K-selection: optimal (CV / BIC) and sequence (sequential test) methods.
fit
PLS1 model fitting (NIPALS loop). NIPALS PLS1 fit. Public entry point: pls1_fit.
linalg
Low-level linear algebra helpers (standardize, row-subset, etc.). Linear-algebra and small-stat helpers shared across the core.
perm_null
Permutation-null engine for signed per-voxel z statistics. Powers the TFCE / cluster-mass / max-stat downstream pipeline. Permutation-null engine for signed per-voxel z statistics on PLS1 β.
predict
PLS1 prediction from a fitted model. Apply a fitted PLS1 model to new X → ŷ in raw scale.
preprocess
Public preprocess helper: validates/normalizes weights and standardizes (X, y). Public preprocess helper. Normalizes weights and standardizes (X, y) using §3.2 math.
resample
Resampling utilities (permutation indices, split-half indices). Resampling engines used by signal_test, sequential, and find_k. Crate-internal — public surface is the callers.
rng
Seeded RNG construction. RNG path for plskit. ChaCha8Rng + pre-computed child seeds.
rotate
Simple-structure rotation of PLS weights (varimax in v0.1.1). Simple-structure rotation of PLS weights. v0.1.1 ships varimax via pairwise Kaiser sweeps; the RotationMethod enum is parameterized so promax / oblimin / geomin can land later without changing the surface.
rotation_stability
Rotation-stability diagnostic for PLS1. Rotation-stability diagnostic for PLS1. Standalone subsampling pass that asks “does varimax rotation make axes more replicable than they would have been on the unrotated NIPALS basis?” Output is a paired rotated-vs-unrotated variance ratio with paired-bootstrap CIs.
signal_test
Confirmatory PLS1 omnibus test at fixed K. Confirmatory PLS1 omnibus test at fixed K: five methods.

Structs§

CIScalar
Centered-scaled subsampling CI for a scalar functional, plus its SD. Marshalled to a frozen dataclass on the Python side; fields must not be reordered.
ConfirmatoryCI
Output of the confirmatory subsampling engine. Marshalled into ConfirmatoryCI at the wrapper layer.

Functions§

version
Returns the CARGO_PKG_VERSION string (e.g. "0.0.1").