Localised modelling: why?

  • Global linear models assume a single spectrum–response relationship: heterogeneous libraries may violate this.

  • Local modelling (a.k.a memory-based learning) restricts fitting to spectrally similar samples, reducing the impact of domain shift (Næs et al., 1990; Shenk et al., 1997)

All models are wrong, but some are useful(Box, 1976)

Localised modelling

mbl

Localised modelling: Trade-offs…

  • Per-query refitting → computational cost at prediction time

  • Full-library access required at prediction → data-sharing constraints

  • No general-purpose interpretation across query-specific models

  • Sensitivity to neighbour selection and spectral inconsistencies

Why refit when you can retrieve?

Our proposal …

liblex

\[\mathcal{D}_r := \{(\mathbf{x}_r^j, y_r^j)\}_{j=1}^n\]

liblex

\[\mathcal{A} \subseteq \{1, \dots, n\}\]

liblex

\[\mathcal{N}_k(a) = \{a\} \cup \mathrm{NN}_{k-1}(a), \quad |\mathcal{N}_k(a)| = k\]

liblex

\[f_a: \mathbb{R}^d \to \mathbb{R}, \quad \mathbf{c}_a = \frac{1}{k}\sum_{j \in \mathcal{N}_k(a)} \mathbf{x}_r^j\]

liblex

\[\mathcal{L} := \{(f_a, \mathbf{c}_a)\}_{a \in \mathcal{A}}\]

liblex

liblex

\(\hat{y}(\mathbf{x}) = \sum_{a \in \mathcal{H}(\mathbf{x})} w_a(\mathbf{x})\, f_a(\mathbf{x}) \text{; } \rightarrow \mathcal{H}(\mathbf{x}) \text{: the }h \text{ nearest experts by centroid dissimilarity}\)

liblex

liblex

Library of local experts

Operationalisation

  • No per-query model refitting

  • Deployment without access to the full reference library, preserving privacy

  • Interpretable local models

  • Intrinsic per-sample uncertainty proxy

  • Anchor spectra or samples with missing \(y\) values

  • Incrementally extensible

  • Competitive predictive accuracy

  • Robust under severe domain shift?

Background

Ramirez-Lopez et al. (2026)

An experiment [1/2]…

A soil IR spectral library from the North America (Hengl et al., 2021)

Open source

liblex

An experiment [2/2]…

A soil IR spectral dataset from our target domain (Summerauer et al., 2021)

Target \(y\): Total carbon

liblex

Variable importance results [1/2]

liblex

Variable importance results [2/2]

liblex

Which anchors gave birth to our relevant experts?

liblex

Validation with independent samples…

liblex

Open-source implementation…

[since 2013]

liblex

https://cran.r-project.org/package=resemble

liblex()

Open-source implementation…

[since 2013]

liblex

https://cran.r-project.org/package=resemble

and matlab?

Future work

  • Learned gating (stacking / meta-learner) as an alternative to distance-based weights

  • Alternative dissimilarities (metric learning, embeddings)

  • Incremental update policies and expert pruning

  • Non-linear or hybrid expert architectures

Our contributions

  • Reformulate MBL: retrieval and aggregation of pre-computed local experts, replacing per-query refitting

  • Retrieval-gated ensembling via centroid dissimilarity, decoupling neighbourhood definition from model centring

  • Intrinsic per-sample uncertainty proxy from expert dispersion

  • Deployment without full-library access, supporting privacy-preserving collaboration

Peace

This presentation:

References

Box, G.E., 1976. Science and statistics. Journal of the American Statistical Association 71, 791–799.
Hengl, T., Sanderman, J., Parente, L., 2021. Open soil spectral library: Training data and calibration models. https://doi.org/10.5281/zenodo.5759694
Næs, T., Isaksson, T., Kowalski, B.R., 1990. Locally weighted regression and scatter correction for near-infrared reflectance data. Analytical Chemistry 62, 664–673.
Ramirez-Lopez, L., Rossel, R.V., Orellano, C., Kooijman, L., Perez-Fernandez, E., Wadoux, A.M.-C., Plans, M., Breure, T., Summerauer, L., Safanelli, J.L., others, 2026. When spectral libraries are too complex to search: Evolutionary subset selection for domain-adaptive calibration. Analytica Chimica Acta 345651. https://doi.org/10.1016/j.aca.2026.345651
Shenk, J.S., Westerhaus, M.O., Berzaghi, P., 1997. Investigation of a local calibration procedure for near infrared instruments. Journal of Near Infrared Spectroscopy 5, 223–232.
Summerauer, L., Baumann, P., Ramirez-Lopez, L., Barthel, M., Bauters, M., Bukombe, B., Reichenbach, M., Boeckx, P., Kearsley, E., Van Oost, K., others, 2021. The central african soil spectral library: A new soil infrared repository and a geographical prediction analysis. SOIL 7, 693–715.