variable_select_sr — Selectivity Ratio¶
Group: Variable selector · Registry tolerance: 1e-06
Description¶
Selectivity-Ratio top-k (§18 Phase 5a, method=2)
Registry note — R
plsVarSel::SRonpls::plsr(method='simpls', scale=FALSE). Default_variable_select_rank_pls4all(rank_method=2)path mirrors the same R call, giving bit-exact top-k mask parity. SR is deterministic (no RNG), so no seed pinning is required. The C++variable_select_rankSR path (per-feature X-energy reconstruction) is opt-in vialegacy=True.
Parameters¶
Name |
Type |
Default |
Notes |
|---|---|---|---|
|
|
|
registry benchmark cell value |
|
|
|
registry benchmark cell value |
Explanations¶
Bibliographic source¶
Rajalahti, T., Arneberg, R., Berven, F. S., Myhr, K.-M., Ulvik, R. J. & Kvalheim, O. M. (2009). Biomarker discovery in mass spectral profiles by means of selectivity ratio plot. Chemometrics and Intelligent Laboratory Systems 95(1), 35–48. Verified primary link: https://doi.org/10.1016/j.chemolab.2008.08.004.
Mathematical principle¶
Selectivity Ratio (SR) measures the relative explained-to-residual variance of each feature along the target-projected PLS direction: \(\mathrm{SR}_j = \mathrm{Var}(\hat{x}_j) / \mathrm{Var}(x_j - \hat{x}_j)\), where \(\hat{x}_j\) is the projection of feature \(j\) onto the target-projected loading vector \(\mathbf{p}_{\mathrm{tp}}\) (a single direction in \(\mathbf{X}\) space that captures all \(\mathbf{Y}\)-correlated variation).
High SR means a feature’s variance is dominated by its \(y\)-correlated part; low SR means the feature’s variance is mostly orthogonal to \(y\) (noise / interferent / matrix). SR therefore separates predictive features from structurally-correlated nuisance features.
Unlike VIP, SR works with a single direction (the target projection), which means it scales gracefully to very many components and is interpretable as a univariate diagnostic per feature.
Appropriate uses¶
Ranking variables by selectivity ratio to favour explained target-related variance over residual variance.
Limits and validation¶
Scores depend on the fitted latent model and preprocessing; collinearity can distribute signal over neighbouring bands.
Implementation¶
n4m_feature_selection_variable_select_rank with metric=SR.
Sources and provenance¶
Current implementation: cpp/src/core/variable_selection.cpp.
API and bindings¶
C ABI (ABI 2): n4m_feature_selection_variable_select_rank. 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: no current source-verified entry point was found for this catalog method.
MATLAB / Octave: no current source-verified entry point was found for this catalog method.
Registry parity references 📐
📐
ref.r_plsvarsel(R · r) —plsVarSel0.10.0 · strict (rmse_rel ≤ 1e-06) — RplsVarSel::SRselectivity ratio on a fittedpls::plsrmodel. Top-k indices.
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 | 542.8 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ J 1.00 | 1.2 s |
pls4all.sklearn | ⇄ J 0.25 | 8.28 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ⇄ J 0.25 | 24.1 ms |
pls4all.R.formula | ⇄ J 0.25 | 11.2 ms |
pls4all.R.mdatools | ⇄ J 0.25 | 22.3 ms |
pls4all.R.pls | ⇄ J 0.25 | 31.6 ms |
| R · external | ||
📐ref.r_plsvarsel | source | 18.9 ms |
| Backend | Parity | 200×40 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ J 1.00 | 780.0 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ J 1.00 | 377.8 ms |
pls4all.sklearn | ⇄ J 0.25 | 2.81 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ⇄ J 0.25 | 20.2 ms |
pls4all.R.formula | ⇄ J 0.25 | 7.53 ms |
pls4all.R.mdatools | ⇄ J 0.25 | 8.89 ms |
pls4all.R.pls | ⇄ J 0.25 | 8.23 ms |
| R · external | ||
📐ref.r_plsvarsel | source | 11.4 ms |
| Backend | Parity | 200×40 (ms) |
|---|---|---|
| C++ native · libn4m | ||
pls4all.cpp.blas+omp | ✓ J 1.00 | 692.5 ms |
| Python · archived pls4all benchmark | ||
pls4all.python | ✓ J 1.00 | 1.3 s |
pls4all.sklearn | ⇄ J 0.25 | 5.57 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ⇄ J 0.25 | 6.01 ms |
pls4all.R.formula | ⇄ J 0.25 | 8.76 ms |
pls4all.R.mdatools | ⇄ J 0.25 | 6.96 ms |
pls4all.R.pls | ⇄ J 0.25 | 6.89 ms |
| R · external | ||
📐ref.r_plsvarsel | source | 12.7 ms |
See also: benchmark overview · methods index · interactive dashboard