interval_select — iPLS — Interval PLS (moving-window)

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

Description

Interval/iPLS forward selection (§18 Phase 5b)

Registry note — R mdatools::ipls(method='forward'). Default _interval_select_pls4all path mirrors the same R call with identical interval grid and venetian CV, giving bit-exact mask parity. The C++ contiguous-fold kernel is opt-in via legacy=True.

Parameters

Name

Type

Default

Notes

interval_size

int

32

current public binding signature

step

int | None

None

current public binding signature

n_components

int

4

registry benchmark cell value

interval_width

int

5

registry benchmark cell value

interval_step

int

2

registry benchmark cell value

Explanations

Bibliographic source

Nørgaard, L., Saudland, A., Wagner, J., Nielsen, J. P., Munck, L. & Engelsen, S. B. (2000). Interval partial least-squares regression (iPLS): a comparative chemometric study with an example from near-infrared spectroscopy. Applied Spectroscopy 54(3), 413–419. Verified primary link: https://doi.org/10.1366/0003702001949500.

Mathematical principle

Slide a fixed-width window of \(w\) consecutive wavelengths across the spectrum, fit PLS on each window alone, evaluate by CV-RMSE. The window with the lowest CV-RMSE is returned as the selected interval.

iPLS is the simplest interval selector — it returns a single contiguous band rather than scattered wavelengths. The output is therefore directly interpretable as a spectroscopic feature (functional group, electronic transition, …). For multi-band selection use biPLS or siPLS.

The window width \(w\) is the main tunable; cross-validating \(w\) jointly with the window position is the standard extension.

Appropriate uses

Selecting contiguous spectral intervals when bands are expected to carry joint chemical information.

Limits and validation

The answer depends on interval partition and width; coarse boundaries can split or dilute informative peaks.

Implementation

n4m_feature_selection_interval_select. Reference: R plsVarSel.

Sources and provenance

Current implementation: cpp/src/core/interval_selection.cpp.

API and bindings

C ABI (ABI 2): n4m_feature_selection_interval_generator_create · n4m_feature_selection_interval_generator_destroy · n4m_feature_selection_interval_generator_fit · n4m_feature_selection_interval_generator_is_fitted · n4m_feature_selection_interval_generator_output_cols · n4m_feature_selection_interval_generator_transform · n4m_feature_selection_interval_select. Use the linked public header for the exact signature, configuration, and result handles.

Python (verified public re-export):

from n4m.feature_selection.interval import IntervalGenerator

Source signature: IntervalGenerator(interval_size: int = 32, step: int | None = None) (n4m/_impl/advanced.py).

R (source-verified): interval_select(X, Y, n_components, interval_width = 10L, step = 1L).

The source signature has additional required inputs, so no example call is fabricated.

MATLAB / Octave (source-verified): interval_select(X, Y, n_components, interval_width, step).

The source signature has additional required inputs, so no example call is fabricated.

Registry parity references 📐

  • 📐 ref.r_mdatools (R · r) — mdatools 0.15.0 · strict (rmse_rel ≤ 1e-06) — R mdatools::ipls forward-iPLS — returns the union of selected interval variables. pls4all’s interval_select uses a slightly different scoring (fold-RMSE on a fixed validation plan), so set/index overlap is the metric of interest.

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.001.5 s
Python · archived pls4all benchmark
pls4all.python✓ J 1.001.5 s
pls4all.sklearn⇄ J 0.503.75 ms🏆
R · archived pls4all benchmark
pls4all.R⇄ J 0.5010.9 ms
pls4all.R.formula⇄ J 0.5011.7 ms
pls4all.R.mdatools⇄ J 0.5013.9 ms
pls4all.R.pls⇄ J 0.5010.3 ms
R · external
📐ref.r_mdatoolssource632.3 ms
BackendParity200×40 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ J 1.002.0 s
Python · archived pls4all benchmark
pls4all.python✓ J 1.002.0 s
pls4all.sklearn⇄ J 0.503.95 ms🏆
R · archived pls4all benchmark
pls4all.R⇄ J 0.508.51 ms
pls4all.R.formula⇄ J 0.509.33 ms
pls4all.R.mdatools⇄ J 0.507.09 ms
pls4all.R.pls⇄ J 0.509.36 ms
R · external
📐ref.r_mdatoolssource706.6 ms
BackendParity200×40 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ J 1.001.1 s
Python · archived pls4all benchmark
pls4all.python✓ J 1.00994.2 ms
pls4all.sklearn⇄ J 0.502.26 ms🏆
R · archived pls4all benchmark
pls4all.R⇄ J 0.505.63 ms
pls4all.R.formula⇄ J 0.506.68 ms
pls4all.R.mdatools⇄ J 0.506.61 ms
pls4all.R.pls⇄ J 0.507.03 ms
R · external
📐ref.r_mdatoolssource507.0 ms

See also: benchmark overview · methods index · interactive dashboard