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::SR on pls::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_rank SR path (per-feature X-energy reconstruction) is opt-in via legacy=True.

Parameters

Name

Type

Default

Notes

n_components

int

4

registry benchmark cell value

top_k

int

10

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) — plsVarSel 0.10.0 · strict (rmse_rel ≤ 1e-06) — R plsVarSel::SR selectivity ratio on a fitted pls::plsr model. 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.

BackendParity200×40 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ J 1.00542.8 ms
Python · archived pls4all benchmark
pls4all.python✓ J 1.001.2 s
pls4all.sklearn⇄ J 0.258.28 ms🏆
R · archived pls4all benchmark
pls4all.R⇄ J 0.2524.1 ms
pls4all.R.formula⇄ J 0.2511.2 ms
pls4all.R.mdatools⇄ J 0.2522.3 ms
pls4all.R.pls⇄ J 0.2531.6 ms
R · external
📐ref.r_plsvarselsource18.9 ms
BackendParity200×40 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ J 1.00780.0 ms
Python · archived pls4all benchmark
pls4all.python✓ J 1.00377.8 ms
pls4all.sklearn⇄ J 0.252.81 ms🏆
R · archived pls4all benchmark
pls4all.R⇄ J 0.2520.2 ms
pls4all.R.formula⇄ J 0.257.53 ms
pls4all.R.mdatools⇄ J 0.258.89 ms
pls4all.R.pls⇄ J 0.258.23 ms
R · external
📐ref.r_plsvarselsource11.4 ms
BackendParity200×40 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ J 1.00692.5 ms
Python · archived pls4all benchmark
pls4all.python✓ J 1.001.3 s
pls4all.sklearn⇄ J 0.255.57 ms🏆
R · archived pls4all benchmark
pls4all.R⇄ J 0.256.01 ms
pls4all.R.formula⇄ J 0.258.76 ms
pls4all.R.mdatools⇄ J 0.256.96 ms
pls4all.R.pls⇄ J 0.256.89 ms
R · external
📐ref.r_plsvarselsource12.7 ms

See also: benchmark overview · methods index · interactive dashboard