Fast linear regression — polynomial detrend + SNV feeding an L2-regularised Ridge model.
unvalidatedA fast linear regression baseline.
alpha=1.0) — a well-conditioned high-dimensional linearfit, 5-split shuffle CV.
A quick sanity check and a surprisingly strong baseline on near-linear targets. Trains in a blink; tune alpha by cross-validation for the best bias/variance trade-off.
{
"name": "Detrend + Ridge",
"pipeline": [
{"class": "nirs4all.operators.transforms.Detrend"},
{"class": "nirs4all.operators.transforms.StandardNormalVariate"},
{"class": "sklearn.preprocessing.StandardScaler"},
{"y_processing": {"class": "sklearn.preprocessing.StandardScaler"}},
{"class": "sklearn.model_selection.ShuffleSplit", "params": {"n_splits": 5, "test_size": 0.25, "random_state": 11}},
{"model": {"class": "sklearn.linear_model.Ridge", "params": {"alpha": 1.0}}, "name": "Ridge"}
]
}
# Python
import nirs4all_repository as n4r
pipe = n4r.get("detrend_ridge")
config = pipe.to_nirs4all() # ready for nirs4all.run() / predict()# any language: read the index, fetch + verify
curl https://repository.nirs4all.org/data/index.json
curl https://repository.nirs4all.org/data/pipelines/detrend_ridge/pipeline.json