stability_select — MC-UVE (Monte-Carlo coefficient stability)¶
Group: Variable selector · Registry tolerance: 1e-06
Description¶
Stability/MCUVE selection (§18 Phase 5c)
Registry note — R
plsVarSel::mcuve_plsMonte-Carlo UVE stability ranking with top-k truncation. Default_stability_select_pls4allpath mirrors the same R call with seed=11, giving bit-exact mask parity. The C++ splitmix64 kernel is opt-in vialegacy=True.
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 |
Explanations¶
Bibliographic source¶
Cai, W., Li, Y. & Shao, X. (2008). A variable selection method based on uninformative variable elimination for multivariate calibration of near-infrared spectra. Chemometrics and Intelligent Laboratory Systems 90(2), 188–194. Verified primary link: https://doi.org/10.1016/j.chemolab.2007.10.001.
Mathematical principle¶
For every supplied validation fold, the routine fits the configured model on that fold’s training rows and stores its coefficients. For each feature and target it calculates \(|\bar b|/s_b\); the feature score is the largest of those ratios across targets, and the top_k largest scores are returned. The supplied folds, rather than bootstrap resampling or a frequency threshold, define the repeats.
Appropriate uses¶
Ranking a fixed number of wavelengths by coefficient signal-to-fold-variation when a validation plan is already available.
Limits and validation¶
This routine returns exactly top_k features and supplies no selection frequency or error-control threshold. Correlated wavelengths can exchange signal across folds, inflating coefficient variation and changing the rank; the validation plan must be nested inside model assessment.
Implementation¶
cpp/src/core/stability_selection.cpp computes sample mean and sample standard deviation of each fitted coefficient over plan.folds, takes the maximum target-specific ratio, then stable-sorts it. It is not a bootstrap stability-selection implementation.
Sources and provenance¶
Current implementation: cpp/src/core/stability_selection.cpp.
API and bindings¶
C ABI (ABI 2): n4m_feature_selection_stability_select. Use the linked public header for the exact signature, configuration, and result handles.
Python (verified public re-export):
from n4m.feature_selection.wrapper import Stability
Source signature: Stability(top_k: int, *, n_components: int = 2, n_iterations: int = 50, seed: int = 0, n_folds: int = 3) (n4m/_impl/selection.py).
R (source-verified): stability_select(X, Y, n_components, top_k = 10L).
The source signature has additional required inputs, so no example call is fabricated.
MATLAB / Octave (source-verified): stability_select(X, Y, n_components, top_k).
The source signature has additional required inputs, so no example call is fabricated.
Registry parity references 📐
📐
ref.r_plsvarsel(R · r) —plsVarSel0.10.0 · strict (rmse_rel ≤ 1e-06) — RplsVarSel::mcuve_plsMonte-Carlo UVE. Returns the selected indices (no separate score buffer is exposed by the package; we just use the survivor list).
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-06).
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×40 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ J 1.00 | 690.4 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ J 1.00 | 1.7 s |
pls4all.sklearn | ⇄ J 0.27 | 3.70 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ⇄ J 0.27 | 15.9 ms |
pls4all.R.formula | ⇄ J 0.27 | 6.82 ms |
pls4all.R.mdatools | ⇄ J 0.27 | 8.71 ms |
pls4all.R.pls | ⇄ J 0.27 | 8.38 ms |
| R · external | ||
📐ref.r_plsvarsel | source | 492.8 ms |
| Backend | Parity | 200×40 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ J 1.00 | 727.7 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ J 1.00 | 698.1 ms |
pls4all.sklearn | ⇄ J 0.27 | 1.79 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ⇄ J 0.27 | 6.01 ms |
pls4all.R.formula | ⇄ J 0.27 | 5.91 ms |
pls4all.R.mdatools | ⇄ J 0.27 | 6.92 ms |
pls4all.R.pls | ⇄ J 0.27 | 8.89 ms |
| R · external | ||
📐ref.r_plsvarsel | source | 259.7 ms |
| Backend | Parity | 200×40 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ J 1.00 | 727.3 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ J 1.00 | 1.5 s |
pls4all.sklearn | ⇄ J 0.27 | 1.92 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ⇄ J 0.27 | 5.39 ms |
pls4all.R.formula | ⇄ J 0.27 | 6.52 ms |
pls4all.R.mdatools | ⇄ J 0.27 | 7.32 ms |
pls4all.R.pls | ⇄ J 0.27 | 6.46 ms |
| R · external | ||
📐ref.r_plsvarsel | source | 230.9 ms |
See also: benchmark overview · methods index · interactive dashboard