Initialising the demonstrationLoading the dataset description…
5%Loading…
  1. 1 · Data
  2. 2 · PLS
  3. 3 · AOM-PLS
  4. 4 · Ridge
  5. 5 · AOM-Ridge
  6. 6 · Results

Initialising the demonstration.

AOM paper companion

Compare PLS and Ridge calibration strategies on your spectra

Bring separate calibration and validation X/y files, inspect them, then compare Raw PLS / Raw Ridge, conventional preprocessing HPO and AOM. A documented example is available when you do not have files at hand.

Load my data Try an example All parsing, fitting and prediction remain in this browser tab.
01

Dataset

Start with your spectra and reference values

Load your fixed calibration/validation split first. If you are exploring the method, use one of the documented public measured NIR datasets below.

Local only

Use the standard nirs4all calibration/validation convention. CSV, TSV and TXT are accepted; comma, semicolon, tab and pipe delimiters are detected. X may have a numeric wavelength/wavenumber header; y must contain one numeric response column.

Select the four files above. Files never leave your device.

Synthetic

Choose one public dataset to inspect and run. These are compact deterministic snapshots of measured spectra, with exact source, citation, license and split documented below.

Active dataset

Loading…

Public measured data

Xcal.csvYcal.csvXval.csvYval.csv

Provenance. Open the exact source snapshot ↗

X · spectra

Calibration and held-out spectra

Calibration Validation

A concise spectral summary will appear with the dataset.

y · response

Target distribution by split

A concise target summary will appear with the dataset.

02

Experiment

Configure one fair comparison

Every route uses the same response, model grid, fold assignment, scoring rule and untouched validation rows. HPO and AOM search the same editable preprocessing chains; only the search engine differs.

1

Raw PLS / Raw Ridge

Raw spectra

PLS selects its component count by CV and Ridge selects α on raw X. No additional strict-linear operator is tested.

2

Conventional search

Preprocessing HPO

External CV screens identity plus a strict-linear preprocessing library after the selected input spectra, with every PLS component count or Ridge regularisation value, then refits the winner.

3

Proposed route

AOM

AOM screens the same chain bank and model grid after the selected input spectra. Its native selector chooses the exact compute route from the data dimensions, and identity is always included.

Two model familiesPLS screens 1–H components; Ridge screens a logarithmic α grid
Three calibration routesRaw PLS / Raw Ridge, external preprocessing HPO and native AOM
Fairness lockSame calibration rows · same held-out rows · same fold assignment · same pooled out-of-fold RMSE

Selection uses calibration CV only. Because validation stays untouched, a tuned route can legitimately score below its identity candidate on held-out rows; automatically choosing the validation winner would leak the test set.

03

Results

Held-out comparison

Run the comparison to populate six held-out results, selected settings and diagnostic plots.

PLS · best held-out route

Awaiting results
Held-out RMSE
Raw PLSThe Raw PLS result will appear here.
HPO selectedThe winning HPO pipeline will appear here.
AOM selectedThe AOM operator will appear here.

Run the experiment to compare Raw PLS, PLS-HPO and AOM-PLS directly.

Ridge · best held-out route

Awaiting results
Held-out RMSE
Raw RidgeThe Raw Ridge result will appear here.
HPO selectedThe winning HPO pipeline will appear here.
AOM selectedThe AOM-selected shared chain will appear here.

Run the experiment to compare Raw Ridge, Ridge-HPO and AOM-Ridge directly.

FamilyCalibration routePP pipelineModelRMSE CV ↓RMSE VAL ↓R² VAL ↑Local compute time*Browser elapsedSearch workloadModel HPO / folds / PP
PLSRaw PLS
Preprocessing HPO
PLS HPO search detailsOpen after the experiment to inspect every candidate
Shared protocol

The shared fold plan, scoring rule and parity checks will appear here.

PLS search

Component grid and winning preprocessing pipeline.

PLS HPO candidates and calibration CV scores.
PretreatmentPLS componentsPLS CV RMSESelected
Run the experiment to populate all PLS candidates.
AOM-PLS
RidgeRaw Ridge
Preprocessing HPO
Ridge HPO search detailsOpen after the experiment to inspect every candidate
Shared protocol

The shared fold plan, scoring rule and parity checks will appear here.

Ridge search

Alpha grid and winning preprocessing pipeline.

Ridge HPO candidates and calibration CV scores.
PretreatmentRidge αRidge CV RMSESelected
Run the experiment to populate all Ridge candidates.
AOM-Ridge
CV RMSEMean prediction error across folds of the calibration set. It selects the configuration; lower is better.
Validation RMSEError on untouched rows, used only after selection. This is the main local comparison.
Pipeline abbreviationsID: identity; DT1/DT2: detrending; SG(w,p,d): Savitzky–Golay window, polynomial and derivative; GF: Gaussian filter.
PLS components · Ridge αNumber of latent PLS dimensions and Ridge regularisation strength. Both are selected by calibration CV.
Time · workloadElapsed time is local. Workload separates model HPO, CV folds and preprocessing combinations (HPO) or operators × order (AOM).

* Elapsed wall-clock compute is measured in this browser and depends on your device. Search workload reports the model grid, fold count and preprocessing search separately. The paper's runtime comparison is AOM against preprocessing HPO—not against the standalone PLS/Ridge route.

Independent validation

RMSE by family and calibration route

Raw PLS / Ridge HPO AOM

PLS · independent validation

Measured vs predicted

Raw PLS HPO AOM

Ridge · independent validation

Measured vs predicted

Raw Ridge HPO AOM

What PLS selected

Two routes, two selected spectral views

Compare the spectral shape used by each fitted PLS route. Exact metrics remain in the table above.

Conventional HPOAwaiting selectionPipeline, components and validation RMSE will appear here.
AOM one-shot selectionAwaiting selectionOperator, components and validation RMSE will appear here.

The two comparisons will appear after fitting. Shapes are standardized only for this display; models use the complete transformed values.

How to read this result

A demonstration is one split; the paper is the evidence

This page explains the workflow on one dataset. It does not replace the multi-dataset comparison.

PLS evidence. Across 32 datasets, AOM-PLS wins 22 comparisons against raw PLS and remains near parity with PLS-HPO (median RMSEP ratio 0.990).

Ridge evidence. AOM-Ridge wins 25/32 comparisons against Ridge-HPO (median RMSEP ratio 0.966; Holm-adjusted p = 0.033).

Runtime evidence. The paper compares full HPO (median 710.81 s; 3000 trial fits) with the compact AOM search (1.18–1.63 s; 45 search units).

Next stepKeep the comparison reproducibleWhen you have reviewed the held-out metrics and plots, copy the matching Python or R setup for your project.
Open installation and code ↓
04

Scope

Reproducibility and limits

This companion runs a compact six-route experiment. It makes one complete held-out comparison auditable and portable.

01

Traceable inputs

The bundled snapshots point to their exact nirs4all source. Uploaded files are parsed locally and never transmitted.

02

Comparable routes

All six routes see the same X, y, folds and validation rows. Displayed metrics come only from the held-out partition.

03

Native browser fit

PLS, Ridge and both AOM methods call the n4m native C ABI compiled to WebAssembly.

04

Deployable outcome

AOM folds the selected strict-linear chain into coefficients and an intercept. Raw input is direct; a selected SNV or MSC input basis must be replayed first.

Scope note

Illustration, not a benchmark claim

The included datasets were generated to exercise nirs4all formats and spectral metadata. Any one dataset can favor raw, HPO or AOM. Use the paper and supplementary material—not a selected fixture—for the multi-dataset claims.

05

Continue

Use AOM in your own workflow

Move from this browser comparison to a reproducible script. The examples use the same separate Xcal, Ycal, Xval and Yval files.

Python package

Run PLS and Ridge from your script

The sklearn-compatible package exposes AOM-PLS and AOM-Ridge Blender. The complete preprocessing-HPO protocol used by the paper remains available in the GitHub benchmark code.

python -m pip install nirs4all-aom pandas scikit-learn
compare_aom.py
import numpy as np
import pandas as pd
from sklearn.cross_decomposition import PLSRegression
from sklearn.linear_model import Ridge
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import GridSearchCV, KFold
from aom_nirs.pls import AOMPLSRegressor
from aom_nirs.ridge import AOMRidgeBlender

def read_x(path):
    return pd.read_csv(path, sep=None, engine="python").to_numpy(float)

def read_y(path):
    return pd.read_csv(path, sep=None, engine="python").iloc[:, 0].to_numpy(float)

Xcal, ycal = read_x("Xcal.csv"), read_y("Ycal.csv")
Xval, yval = read_x("Xval.csv"), read_y("Yval.csv")
cv = KFold(n_splits=5, shuffle=False)
budget = range(1, min(25, Xcal.shape[1], len(Xcal) - 1) + 1)
alpha_grid = [1e-8, 1e-6, 1e-4, 1e-2, 1, 1e2, 1e4]

raw = GridSearchCV(
    PLSRegression(scale=False), {"n_components": budget},
    cv=cv, scoring="neg_root_mean_squared_error"
).fit(Xcal, ycal)

aom = AOMPLSRegressor(
    n_components="auto", max_components=max(budget),
    operator_bank="compact", criterion="cv", cv=5,
    cv_splitter=cv, random_state=0
).fit(Xcal, ycal)

raw_ridge = GridSearchCV(
    Ridge(), {"alpha": alpha_grid}, cv=cv,
    scoring="neg_root_mean_squared_error"
).fit(Xcal, ycal)

aom_ridge = AOMRidgeBlender(
    outer_cv=5, inner_cv=5, outer_cv_kind="kfold",
    regularizer=0.01, random_state=0, n_jobs=-1
).fit(Xcal, ycal)

models = {
    "Raw PLS": raw, "AOM-PLS": aom,
    "Raw Ridge": raw_ridge, "AOM-Ridge": aom_ridge,
}
for name, model in models.items():
    pred = np.asarray(model.predict(Xval)).ravel()
    rmsep = np.sqrt(mean_squared_error(yval, pred))
    print(f"{name:10s} RMSEP = {rmsep:.4g}")

print("AOM operator:", aom.selected_operators_)
print("AOM components:", aom.n_components_)
print("AOM-Ridge weights:", aom_ridge.weights_)

If your files do not contain a header row, add header=None to each read_csv call.