random_frog_select — Random Frog¶
Group: Variable selector · Registry tolerance: 1e-06
Description¶
Random Frog selection (§18 Phase 5g)
Registry note — Python
auswahl.RandomFrog(LSX-UniWue; Li 2012). Same algorithm as libPLSrandomfrog_pls. Default_random_frog_select_pls4allpath mirrors the same auswahl call withrandom_state=seed, giving bit-exact mask parity. The C++ splitmix64 kernel is opt-in vialegacy=True.
Parameters¶
Name |
Type |
Default |
Notes |
|---|---|---|---|
|
|
|
current public binding signature |
|
|
|
current public binding signature |
|
|
|
current public binding signature |
|
|
|
current public binding signature |
|
|
|
current public binding signature |
|
|
|
current public binding signature |
|
|
|
current public binding signature |
|
|
|
current public binding signature |
Explanations¶
Bibliographic source¶
Li, H., Xu, Q. & Liang, Y. (2012). Random frog: an efficient reversible jump Markov chain Monte Carlo-like approach for variable selection. Analytica Chimica Acta 740, 20–26. Verified primary link: https://doi.org/10.1016/j.aca.2012.06.031.
Mathematical principle¶
Random Frog runs a random walk over feature subsets: at each step it proposes a transition to a neighbouring subset (add / remove / swap a feature) and accepts the transition with a Metropolis-style probability based on the improvement in CV-RMSE. Features that appear frequently in the visited subsets are deemed important.
Output: the inclusion frequency vector — fraction of iterations in which each feature was selected. Sort by frequency and take the top-\(k\) for the final subset.
Random Frog is sample-efficient compared to GA-PLS (no population of full subsets to maintain) but slower to mix on very high-dimensional data. Recommended on spectra of moderate size (a few hundred wavelengths).
Appropriate uses¶
Sampling variable subsets to estimate inclusion probabilities under a PLS validation objective.
Limits and validation¶
Finite-chain inclusion frequencies depend on initialization, proposal settings, and seed; they are not Bayesian posterior probabilities.
Implementation¶
n4m_feature_selection_random_frog_select.
Sources and provenance¶
Current implementation: cpp/src/core/random_frog_selection.cpp.
API and bindings¶
C ABI (ABI 2): n4m_feature_selection_random_frog_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 RandomFrog
Source signature: RandomFrog(top_k: int, *, n_components: int = 2, n_iterations: int = 100, initial_size: int = 20, min_size: int | None = None, max_size: int | None = None, n_folds: int = 3, seed: int = 0) (n4m/_impl/selection.py).
R (source-verified): random_frog_select(X, Y, n_components, n_iterations = 100L, initial_size = 30L, min_size = NULL, max_size = NULL, top_k = 10L, seed = 0L).
The source signature has additional required inputs, so no example call is fabricated.
MATLAB / Octave (source-verified): random_frog_select(X, Y, n_components, n_iterations, ... initial_size, min_size, max_size, top_k, seed).
The source signature has additional required inputs, so no example call is fabricated.
Registry parity references 📐
📐
ref.python_auswahl(python · python) —auswahl0.9.0 · strict (rmse_rel ≤ 1e-06) — Pythonauswahl.RandomFrog(LSX-UniWue; Li 2012). Same algorithm as libPLSrandomfrog_plswith pinnedrandom_statefor bit-exact mask parity.
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) |
|---|---|---|
| Python · archived pls4all benchmark | ||
pls4all.sklearn | ✓ J 0.18 | 2.19 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ J 0.18 | 4.98 ms |
pls4all.R.formula | ✓ J 0.18 | 5.67 ms |
pls4all.R.mdatools | ✓ J 0.18 | 5.96 ms |
pls4all.R.pls | ✓ J 0.18 | 5.94 ms |
| Backend | Parity | 200×40 (ms) |
|---|---|---|
| Python · archived pls4all benchmark | ||
pls4all.sklearn | ✓ J 0.18 | 2.19 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ J 0.18 | 4.83 ms |
pls4all.R.formula | ✓ J 0.18 | 5.64 ms |
pls4all.R.mdatools | ✓ J 0.18 | 5.77 ms |
pls4all.R.pls | ✓ J 0.18 | 5.73 ms |
| Backend | Parity | 200×40 (ms) |
|---|---|---|
| Python · archived pls4all benchmark | ||
pls4all.sklearn | ✓ J 0.18 | 2.19 ms🏆 |
| R · archived pls4all benchmark | ||
pls4all.R | ✓ J 0.18 | 5.15 ms |
pls4all.R.formula | ✓ J 0.18 | 5.73 ms |
pls4all.R.mdatools | ✓ J 0.18 | 5.76 ms |
pls4all.R.pls | ✓ J 0.18 | 5.71 ms |
See also: benchmark overview · methods index · interactive dashboard