sparse_pls_da — Sparse PLS-DA (Lê Cao 2008)¶
Group: Sparse · Registry tolerance: 1e-08
Description¶
Sparse PLS-DA (§7)
Registry note — R
spls::splsdauses an LDA classifier on PLS scores; pls4all andSparsePlsDaPythonReferenceuse argmax of the regression decision scores. Both emit one-hot predictions; differences appear only at the decision boundary.
Parameters¶
Name |
Type |
Default |
Notes |
|---|---|---|---|
|
|
|
registry benchmark cell value |
|
|
|
registry benchmark cell value |
|
|
|
registry benchmark cell value |
Explanations¶
Bibliographic source¶
Lê Cao, K.-A., Rossouw, D., Robert-Granié, C. & Besse, P. (2008). A sparse PLS for variable selection when integrating omics data. Statistical Applications in Genetics and Molecular Biology 7(1). Verified primary link: https://doi.org/10.2202/1544-6115.1390.
Mathematical principle¶
Class labels are encoded as one-hot response columns and a sparse PLS regression model produces one score per class. Prediction selects the largest score and writes a one-hot class vector. This supplies a discriminant rule but does not normalize the scores into probabilities.
Appropriate uses¶
Sparse multiclass discrimination with one-hot responses and an interpretable wavelength subset.
Limits and validation¶
The prediction surface emits an argmax class and one-hot output, not calibrated softmax probabilities.
Implementation¶
The C result wrapper performs argmax over class scores and emits zero/one entries. Probability calibration, softmax conversion, and rejection thresholds are not part of this method.
Sources and provenance¶
Current implementation: cpp/src/c_api/c_api_method_result.cpp.
API and bindings¶
C ABI (ABI 2): n4m_estimators_sparse_pls_da_fit. Use the linked public header for the exact signature, configuration, and result handles.
Python: no current AST-verified public n4m re-export was found for this method. The linked C ABI above is the documented surface in this checkout.
R (source-verified): sparse_pls_da_fit(X, y_labels, n_components, sparsity_lambda = 0.05).
The source signature has additional required inputs, so no example call is fabricated.
MATLAB / Octave (source-verified): sparse_pls_da(X, y_labels, n_components, sparsity_lambda).
The source signature has additional required inputs, so no example call is fabricated.
Registry parity references 📐
📐
ref.python_chun_keles_splsda(python · python) —chun_keles_splsda1.0 · strict (rmse_rel ≤ 1e-08) — Sparse SIMPLS (Chun & Keles 2010) on dummy-coded class labels, followed by argmax over decision scores. Mirrors pls4all’sn4m_estimators_sparse_pls_da_fit(default, cfg.sparse_simpls_legacy = 0) bit-for-bit.📐
ref.r_spls(R · r) —spls2.3.2 · strict (rmse_rel ≤ 1e-08) — Rspls::splsda(Chun & Keles). Predictions returned as hard class labels by the package; we one-hot encode them to match pls4all’s soft-assignment prediction shape, so the parity check is on the classification boundary rather than continuous score values.
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 | 7.43 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 4.50 ms |
pls4all.sklearn | ⇄ +7e-01 | 2.45 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ bind | 7.20 ms |
pls4all.R.formula | ✓ bind | 8.68 ms |
pls4all.R.mdatools | ✓ bind | 8.43 ms |
pls4all.R.pls | ✓ bind | 8.53 ms |
| Python · external | ||
📐ref.python_chun_keles_splsda | source | 3.58 ms |
| R · external | ||
📐ref.r_spls | ⇄ +1e+00 | 82.9 ms |
| Backend | Parity | 200×50 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ ref | 12.7 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 8.19 ms |
pls4all.sklearn | ⇄ +7e-01 | 5.55 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ bind | 23.8 ms |
pls4all.R.formula | ✓ bind | 31.7 ms |
pls4all.R.mdatools | ✓ bind | 37.4 ms |
pls4all.R.pls | ✓ bind | 15.7 ms |
| Python · external | ||
📐ref.python_chun_keles_splsda | source | 14.4 ms |
| R · external | ||
📐ref.r_spls | ⇄ +1e+00 | 117.9 ms |
| Backend | Parity | 200×50 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ ref | 7.83 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ bind | 7.59 ms |
pls4all.sklearn | ⇄ +7e-01 | 3.94 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ bind | 12.2 ms |
pls4all.R.formula | ✓ bind | 47.2 ms |
pls4all.R.mdatools | ✓ bind | 26.4 ms |
pls4all.R.pls | ✓ bind | 32.6 ms |
| Python · external | ||
📐ref.python_chun_keles_splsda | source | 6.94 ms |
| R · external | ||
📐ref.r_spls | ⇄ +1e+00 | 91.2 ms |
See also: benchmark overview · methods index · interactive dashboard