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::FindKOptimalOpts;pub use find_k::FindKOptimalOutput;pub use find_k::FindKSequenceOpts;pub use find_k::FindKSequenceOutput;pub use find_k::FindKeepOptimalOpts;pub use find_k::FindKeepOptimalOutput;pub use find_k::Selector;pub use find_k::pls1_find_k_optimal;pub use find_k::pls1_find_k_sequence;pub use find_k::spls1_find_k_optimal;pub use find_k::spls1_find_k_sequence;pub use find_k::spls1_find_keep_optimal;pub use fit::FitOpts;pub use fit::KSpec;pub use fit::ParChoice;pub use fit::Pls1Model;pub use fit::pls1_fit;pub use fit::spls1_fit;pub use perm_alpha::PermAlphaOutput;pub use perm_alpha::pls1_perm_alpha;pub use perm_null::PermNullOpts;pub use perm_null::PermNullOutput;pub use perm_null::pls1_perm_null;pub use pls3::Pls3FitOpts;pub use pls3::Pls3Model;pub use pls3::Pls3Scores;pub use pls3::TransformWhich;pub use pls3::pls3_fit;pub use pls3::pls3_transform;pub use pls3::plssvd_fit;pub use pls3::plssvd_transform;pub use pls3::spls3_fit;pub use pls3_signal_test::Pls3ConfirmatoryTestOpts;pub use pls3_signal_test::pls3_confirmatory_test;pub use predict::pls1_predict;pub use preprocess::PreprocessInput;pub use preprocess::PreprocessResult;pub use preprocess::preprocess;pub use rotate::RotateOutput;pub use rotate::RotationMethod;pub use rotate::VarimaxArgs;pub use rotate::rotate;pub use rotation_stability::RotationStabilityMethod;pub use rotation_stability::RotationStabilityOpts;pub use rotation_stability::RotationStabilityOutput;pub use rotation_stability::pls1_rotation_stability;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;pub use signal_test::SPLIT_NB_REROUTE_N_PERM;pub use signal_test::SplitNbGateOutput;pub use signal_test::pls1_confirmatory_test;pub use signal_test::split_nb_gate;
Modules§
- error
- Error types for plskit.
Error type for plskit. All public functions return
PlsKitResult<T>. - find_k
- K selection (CV / BIC / sequence). K-selection: optimal (CV / BIC) and sequence (sequential test) methods.
- fit
- PLS1 model fitting (the NIPALS PLS1 model, computed by Improved Kernel PLS).
PLS1 fit: the NIPALS PLS1 model, computed by Improved Kernel PLS (one
shared component loop,
pls1_component_loop, with the X backend; seepls1_kernel). Public entry points:pls1_fit,spls1_fit. - linalg
- Low-level linear algebra helpers (standardize, row-subset, etc.). Linear-algebra and small-stat helpers shared across the core.
- perm_
alpha - PLS1 dual coefficients from a caller’s Gram matrix (
pls1_perm_alpha), for callers that hold the standardized block themselves. PLS1 dual coefficients from a Gram matrix:pls1_perm_alpha. - 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 β.
- pls3
- PLS3 / PLSSVD fit and transform (SVD on X’Y, no deflation).
PLS3 / PLSSVD — symmetric X↔Y covariance analysis. Public entry points:
pls3_fit(aliasplssvd_fit) andpls3_transform(aliasplssvd_transform). - pls3_
signal_ test - Confirmatory PLS3 / PLSSVD omnibus test at LV1.
Confirmatory PLS3 / PLSSVD omnibus test at LV1. Two methods over one
statistic:
split_exactcalibrates the held-out LV correlation by permutation,split_nbcompares it against the NB t-reference instead. - predict
- PLS1 prediction from a fitted model. Apply a fitted PLS1 model to new X.
- preprocess
- Public preprocess helper: validates/normalizes weights and standardizes (X, y).
preprocess::preprocess_blockis its multi-column-Yform; it is not re-exported at the crate root because the wrappers expose both forms under the one namepreprocess, dispatching on the shape ofY. Public preprocess helper. Normalizes weights and standardizes (X, y). - 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).
Simple-structure rotation of PLS weights. Varimax is implemented via
pairwise Kaiser sweeps; the
RotationMethodenum 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
- Resampling 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
ConfirmatoryCIat the wrapper layer.
Functions§
- version
- Returns the
CARGO_PKG_VERSIONstring (e.g."0.0.1").