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_pls Monte-Carlo UVE stability ranking with top-k truncation. Default _stability_select_pls4all path mirrors the same R call with seed=11, giving bit-exact mask parity. The C++ splitmix64 kernel is opt-in via legacy=True.

Parameters

Name

Type

Default

Notes

top_k

int

required

current public binding signature

n_components

int

2

current public binding signature

n_iterations

int

50

current public binding signature

seed

int

0

current public binding signature

n_folds

int

3

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) — plsVarSel 0.10.0 · strict (rmse_rel ≤ 1e-06) — R plsVarSel::mcuve_pls Monte-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.

BackendParity200×40 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ J 1.00690.4 ms
Python · archived pls4all benchmark
pls4all.python✓ J 1.001.7 s
pls4all.sklearn⇄ J 0.273.70 ms🏆
R · archived pls4all benchmark
pls4all.R⇄ J 0.2715.9 ms
pls4all.R.formula⇄ J 0.276.82 ms
pls4all.R.mdatools⇄ J 0.278.71 ms
pls4all.R.pls⇄ J 0.278.38 ms
R · external
📐ref.r_plsvarselsource492.8 ms
BackendParity200×40 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ J 1.00727.7 ms
Python · archived pls4all benchmark
pls4all.python✓ J 1.00698.1 ms
pls4all.sklearn⇄ J 0.271.79 ms🏆
R · archived pls4all benchmark
pls4all.R⇄ J 0.276.01 ms
pls4all.R.formula⇄ J 0.275.91 ms
pls4all.R.mdatools⇄ J 0.276.92 ms
pls4all.R.pls⇄ J 0.278.89 ms
R · external
📐ref.r_plsvarselsource259.7 ms
BackendParity200×40 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ J 1.00727.3 ms
Python · archived pls4all benchmark
pls4all.python✓ J 1.001.5 s
pls4all.sklearn⇄ J 0.271.92 ms🏆
R · archived pls4all benchmark
pls4all.R⇄ J 0.275.39 ms
pls4all.R.formula⇄ J 0.276.52 ms
pls4all.R.mdatools⇄ J 0.277.32 ms
pls4all.R.pls⇄ J 0.276.46 ms
R · external
📐ref.r_plsvarselsource230.9 ms

See also: benchmark overview · methods index · interactive dashboard