variable_select_vip — VIP (Variable Importance in Projection)

Group: Variable selector · Registry tolerance: 1e-06

Description

VIP top-k variable selection (§18 Phase 5a, method=0)

Registry note — R plsVarSel::VIP on pls::plsr(method='kernelpls', scale=FALSE). pls4all pins the matching solver (Solver.KERNEL_ALGORITHM, scale_x=False, scale_y=False) and compute_vip_scores implements the same column-normalised W formula, so the selected-index masks agree bit-for-bit (max_abs=0).

Parameters

Name

Type

Default

Notes

top_k

int

required

current public binding signature

n_components

int

2

current public binding signature

rank_method

int

0

current public binding signature

Explanations

Bibliographic source

Wold, S., Sjöström, M. & Eriksson, L. (2001). PLS-regression: a basic tool of chemometrics. Chemometrics and Intelligent Laboratory Systems 58(2), 109–130. Verified primary link: https://doi.org/10.1016/S0169-7439(01)00155-1.

Mathematical principle

VIP scores quantify each feature’s contribution across all \(k\) latent components of a PLS model, weighted by how much each component explains of \(\mathbf{y}\): \(\mathrm{VIP}_j = \sqrt{\frac{p}{\mathrm{SSY}} \sum_{a=1}^{k} w_{ja}^2 \, \mathrm{SSY}_a}\), where \(w_{ja}\) is the loading weight of feature \(j\) in component \(a\) and \(\mathrm{SSY}_a\) is the explained sum of squares of \(\mathbf{y}\) in component \(a\).

The normalisation guarantees \(\sum_j \mathrm{VIP}_j^2 = p\), so the heuristic \(\mathrm{VIP}_j > 1\) identifies features contributing more than their fair share. VIP is the workhorse of spectroscopic variable selection — simple, deterministic, fast, and well understood.

Appropriate uses

Ranking wavelengths by their aggregate contribution to response-oriented PLS components.

Limits and validation

VIP is model-dependent and correlated variables can share or exchange importance; a threshold of one is heuristic.

Implementation

n4m_feature_selection_variable_select_rank with metric=VIP. Reference: R plsVarSel 0.10.0.

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 (verified public re-export):

from n4m.feature_selection.ranking import VariableSelect

Source signature: VariableSelect(top_k: int, *, n_components: int = 2, rank_method: int = 0) (n4m/_impl/selection.py).

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::VIP ranking on pls::plsr(method='kernelpls', scale=FALSE) — matches the pls4all kernel-PLS path used by _variable_select_rank_pls4all(rank_method=0). The top-k indices are returned (1-based -> 0-based in the loader).

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.002.55 ms
Python · archived pls4all benchmark
pls4all.python✓ J 1.002.47 ms
pls4all.sklearn✓ J 1.001.97 ms🏆
R · archived pls4all benchmark
pls4all.R✓ J 1.006.19 ms
pls4all.R.formula✓ J 1.006.51 ms
pls4all.R.mdatools✓ J 1.006.61 ms
pls4all.R.pls✓ J 1.005.86 ms
R · external
📐ref.r_plsvarselsource16.2 ms
BackendParity200×40 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ J 1.008.22 ms
Python · archived pls4all benchmark
pls4all.python✓ J 1.007.47 ms
pls4all.sklearn✓ J 1.002.74 ms🏆
R · archived pls4all benchmark
pls4all.R✓ J 1.0025.1 ms
pls4all.R.formula✓ J 1.0011.1 ms
pls4all.R.mdatools✓ J 1.009.03 ms
pls4all.R.pls✓ J 1.0017.2 ms
R · external
📐ref.r_plsvarselsource18.5 ms
BackendParity200×40 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ J 1.004.22 ms
Python · archived pls4all benchmark
pls4all.python✓ J 1.004.15 ms
pls4all.sklearn✓ J 1.003.66 ms🏆
R · archived pls4all benchmark
pls4all.R✓ J 1.005.24 ms
pls4all.R.formula✓ J 1.006.31 ms
pls4all.R.mdatools✓ J 1.006.76 ms
pls4all.R.pls✓ J 1.006.29 ms
R · external
📐ref.r_plsvarselsource12.5 ms

See also: benchmark overview · methods index · interactive dashboard