ridge_pls — Ridge-augmented PLS¶
Group: Regularised · Registry tolerance: 1e-08
Description¶
Ridge-augmented PLS
Registry note — sklearn PLSRegression on the (X augmented with sqrt(λ)·I, Y augmented with zeros) is the standard data-augmentation trick for L2-penalized PLS. pls4all now defaults to NIPALS on the augmented matrix to match the reference bit-for-bit; SIMPLS on the same augmented matrix introduces a different FP reduction order and diverges by ~1e-3 on small sizes.
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 |
Explanations¶
Bibliographic source¶
Hoerl, A. E. & Kennard, R. W. (1970). Ridge regression: biased estimation for nonorthogonal problems. Technometrics 12(1), 55–67. — combined with PLS via Tikhonov regularisation of the inner regression. Verified primary link: https://doi.org/10.1080/00401706.1970.10488634.
Mathematical principle¶
The current method augments the centred training problem with \(\sqrt{\lambda}\mathbf I_p\) rows in X and matching zero rows in Y, then fits PLS to that augmented problem. Consequently the penalty can alter the latent directions as well as shrink the final regression coefficients.
Appropriate uses¶
Stabilizing latent calibration when the predictor cross-product is ill-conditioned.
Limits and validation¶
The ridge penalty is applied by augmenting X and Y before PLS, so it changes latent directions as well as coefficient shrinkage.
Implementation¶
This augmented-data construction is not equivalent to applying \((\mathbf T^T\mathbf T+\lambda\mathbf I)^{-1}\mathbf T^T\mathbf Y\) after an unchanged PLS score extraction. lambda must be tuned for this implementation.
Sources and provenance¶
Current implementation: cpp/src/core/extra_pls.cpp.
API and bindings¶
C ABI (ABI 2): n4m_estimators_ridge_pls_fit. Use the linked public header for the exact signature, configuration, and result handles.
Python (verified public re-export):
from n4m.estimators.regression.regularized import ridge_pls
result = ridge_pls(X, y)
Source signature: ridge_pls(X, y, *, ridge_lambda: float = 0.1, 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): ridge_pls(formula, data, ncomp = 2L, ridge_lambda = 1.0, na.action = stats::na.omit).
The source signature has additional required inputs, so no example call is fabricated.
MATLAB / Octave (source-verified): ridge_pls(X, Y, n_components, ridge_lambda).
The source signature has additional required inputs, so no example call is fabricated.
Registry parity references 📐
📐
ref.python_scikit_learn(python · python) —scikit-learn1.4.2 · strict (rmse_rel ≤ 1e-08) — Ridge-augmented PLS via sklearn PLSRegression on the (X aug, Y aug) matrices — standard data-augmentation trick to fold an L2 penalty into a least-squares-style algorithm.
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 6e-16 | 1.75 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 1.83 ms |
pls4all.sklearn | ✓ bind | 1.75 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ 1e-14 | 4.62 ms |
pls4all.R.formula | ✓ 1e-14 | 6.20 ms |
pls4all.R.mdatools | ✓ 1e-14 | 5.56 ms |
pls4all.R.pls | ✓ 1e-14 | 5.59 ms |
| Python · external | ||
📐ref.python_scikit_learn | source | 2.19 ms |
| Backend | Parity | 200×50 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ ref 6e-16 | 1.80 ms🏆 |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 1.80 ms |
pls4all.sklearn | ✓ bind | 1.82 ms |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ 1e-14 | 4.67 ms |
pls4all.R.formula | ✓ 1e-14 | 5.85 ms |
pls4all.R.mdatools | ✓ 1e-14 | 5.48 ms |
pls4all.R.pls | ✓ 1e-14 | 5.74 ms |
| Python · external | ||
📐ref.python_scikit_learn | source | 2.20 ms |
| Backend | Parity | 200×50 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ ref 6e-16 | 1.83 ms🏆 |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 1.87 ms |
pls4all.sklearn | ✓ bind | 1.85 ms |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ 1e-14 | 4.60 ms |
pls4all.R.formula | ✓ 1e-14 | 5.61 ms |
pls4all.R.mdatools | ✓ 1e-14 | 5.92 ms |
pls4all.R.pls | ✓ 1e-14 | 6.40 ms |
| Python · external | ||
📐ref.python_scikit_learn | source | 2.20 ms |
See also: benchmark overview · methods index · interactive dashboard