robust_pls — Robust PLS (Partial Robust M-regression)¶
Group: Robust / weighted · Registry tolerance: 1e-08
Description¶
Robust PLS (Partial Robust M-regression, Serneels 2005)
Registry note — R
chemometrics::prm(Serneels et al. 2005) — Partial Robust M-regression. pls4all defaults to PRM matching the R algorithm bit-for-bit (median centering, Fair weights on leverage + residual, univariate SIMPLS inner kernel, intercept = median(y - X@b)). The legacy Huber-IRLS over weighted SIMPLS path is reachable viacfg.robust_pls_legacy = 1.
Parameters¶
Name |
Type |
Default |
Notes |
|---|---|---|---|
|
|
|
current public binding signature |
|
|
|
current public binding signature |
|
|
|
current public binding signature |
|
|
|
current public binding signature |
|
|
|
current public binding signature |
|
|
|
current public binding signature |
|
|
|
current public binding signature |
|
|
|
current public binding signature |
|
|
|
current public binding signature |
Explanations¶
Bibliographic source¶
Serneels, S., Croux, C., Filzmoser, P. & Van Espen, P. J. (2005). Partial robust M-regression. Chemometrics and Intelligent Laboratory Systems 79(1–2), 55–64. DOI 10.1016/j.chemolab.2005.04.007.
Mathematical principle¶
The default robust path follows a partial robust M-regression style iteration: residual and leverage information update Fair robustness weights before weighted latent fits. Fair weights decay smoothly rather than clipping residual influence at the Huber threshold.
Appropriate uses¶
Calibration containing moderate response or leverage contamination where robust residual weighting is justified.
Limits and validation¶
The default PRM-style path uses Fair weights and reinterprets huber_k as its tuning constant; Huber IRLS is available only in legacy mode.
Implementation¶
In the default path the public huber_k value is interpreted as the Fair tuning constant for parity with the referenced implementation. The separately gated legacy branch performs the Huber IRLS algorithm described by older documentation.
Sources and provenance¶
Current implementation: cpp/src/core/extra_pls.cpp.
API and bindings¶
C ABI (ABI 2): n4m_estimators_robust_pls_fit. Use the linked public header for the exact signature, configuration, and result handles.
Python (verified public re-export):
from n4m.estimators.regression.robust import robust_pls
result = robust_pls(X, y)
Source signature: robust_pls(X, y, *, huber_k: float = 1.345, max_irls_iter: int = 5, n_components: int = 2, center_x: bool | None = None, scale_x: bool | None = None, center_y: bool | None = None, scale_y: bool | None = None) (n4m/_impl/native.py).
R (source-verified): robust_pls(formula, data, ncomp = 2L, huber_k = 1.345, max_irls_iter = 20L, na.action = stats::na.omit).
The source signature has additional required inputs, so no example call is fabricated.
MATLAB / Octave (source-verified): robust_pls(X, Y, n_components, huber_k, max_irls_iter).
The source signature has additional required inputs, so no example call is fabricated.
Registry parity references 📐
📐
ref.r_chemometrics(R · r) —chemometrics0.7.x · strict (rmse_rel ≤ 1e-08) — Rchemometrics::prm(Partial Robust M-regression). pls4all uses Huber IRLS over weighted SIMPLS; this is an M-estimator variant from the same family. Predictions diverge by O(0.5).
Benchmarks¶
Archived measurement identity. Backend labels in this table are the raw IDs recorded when the benchmark ran (including historical pls4all.* IDs). They preserve measurement provenance and do not describe a current public Python, R, or MATLAB binding; use the source-verified API and bindings section above for current entry points.
Adaptive wall-clock per cell measured against full_matrix.csv. Only backends that implement this method are listed; libraries without the method are omitted.
Verdict · ✓ ref / ≈ ref / ~ shape mark a reference-gate pass at strict / relaxed / qualitative tolerance · ✓ bind = archived binding-harness result agrees with the C++ baseline · ⇄ cross-check = documented by-design selector/RNG/model, noncanonical API/facade convention, or secondary oracle · ✗ divergent · ⚠ error · — not run. The fastest backend per column is marked 🏆.
Reference gate: strict — numeric equivalence (rmse_rel_tol ≤ 1e-08).
Rows tagged with 📐 are the canonical parity references for this method (declared in parity_timing.registry). C++ and external rows show reference parity; archived language-harness rows show binding parity against the C++ backend. Hover the icon for role and tolerance band.
| Backend | Parity | 200×50 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ ref 1e-14 | 2.07 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 1.95 ms🏆 |
pls4all.sklearn | ✓ bind | 2.15 ms |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ bind | 4.38 ms |
pls4all.R.formula | ✓ bind | 5.55 ms |
pls4all.R.mdatools | ✓ bind | 5.77 ms |
pls4all.R.pls | ✓ bind | 6.62 ms |
| R · external | ||
📐ref.r_chemometrics | source | 17.9 ms |
| Backend | Parity | 200×50 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ ref 1e-14 | 2.02 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 2.00 ms🏆 |
pls4all.sklearn | ✓ bind | 2.10 ms |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ bind | 5.43 ms |
pls4all.R.formula | ✓ bind | 6.63 ms |
pls4all.R.mdatools | ✓ bind | 5.84 ms |
pls4all.R.pls | ✓ bind | 5.99 ms |
| R · external | ||
📐ref.r_chemometrics | source | 17.0 ms |
| Backend | Parity | 200×50 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ ref 1e-14 | 2.05 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 1.98 ms🏆 |
pls4all.sklearn | ✓ bind | 2.25 ms |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ bind | 4.94 ms |
pls4all.R.formula | ✓ bind | 7.07 ms |
pls4all.R.mdatools | ✓ bind | 5.59 ms |
pls4all.R.pls | ✓ bind | 5.68 ms |
| R · external | ||
📐ref.r_chemometrics | source | 17.5 ms |
See also: benchmark overview · methods index · interactive dashboard