repository
catalogue / detrend_ridge

Detrend · SNV · Ridge

Fast linear regression — polynomial detrend + SNV feeding an L2-regularised Ridge model.

unvalidated

Overview

Detrend · SNV · Ridge

A fast linear regression baseline.

What it does

  1. Detrend — removes low-order polynomial baseline curvature.
  2. SNV — removes multiplicative scatter.
  3. Standardisation of features and target.
  4. Ridge regression (L2, alpha=1.0) — a well-conditioned high-dimensional linear

fit, 5-split shuffle CV.

When to use it

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.

Recipe

{
  "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"}
  ]
}

Use it

# 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

Metadata

framework
nirs4all
kind
recipe
task
regression
version
1.0.0
license
CeCILL-2.1 OR AGPL-3.0-or-later
trust
community
tags
ridge, detrend, snv, linear
authors
Gregory Beurier
reference
regression_demo

Expected metrics

test · rmse0.165 ±0.05
val · rmse0.14 ±0.04
statusunvalidated

Provenance

Download

recipe
pipeline.json
descriptor
descriptor.yaml