Skip to main content

nirs4all-aom

Adaptive Operator-Mixture PLS and Ridge for near-infrared spectroscopy.

Companion code for the paper "Operator-adaptive PLS and Ridge calibration for NIR spectroscopy" (manuscript in paper/).

This repository ships three sklearn-compatible model families plus benchmark runners:

  • aom_nirs.pls — AOM-PLS, POP-PLS, AOM-PLS-DA, POP-PLS-DA. Operator-adaptive PLS that integrates strict-linear preprocessing operators (identity, Savitzky-Golay, finite difference, detrend, Norris-Williams, Whittaker, FCK) into the calibration via covariance / NIPALS / SIMPLS identities. Replaces external preprocessing grid-search.
  • aom_nirs.ridge — AOM-Ridge family (AOMRidgeRegressor, AOMRidgeBlender, AOMRidgeAutoSelector, AOMRidgeClassifier, plus AOMRidgePLS, AOMMultiKernelRidge, AOMMultiBranchMKL, AOMLocalRidge). Dual / kernel Ridge with operator-mixture preprocessing. The paper's best empirical result (median RMSEP ratio 0.918 vs Ridge-default on 32 NIRS datasets, two-sided Wilcoxon Holm-corrected $p = 5.2\times 10^{-4}$).
  • aom_nirs.fast — FastAOM chain-screening framework. Adjoint-only covariance screening with diversity-aware top-k, low-rank kernel evaluator, and four sklearn-style models (SingleChainPLSRidge, HardAOMChainPLSRidge, SoftAOMChainPLSRidge, SparseChainPLSRidge).

Installation

pip install nirs4all-aom                # core
pip install "nirs4all-aom[torch]"        # GPU NIPALS / SIMPLS / superblock
pip install "nirs4all-aom[tabpfn]"       # TabPFN-residual experimental stacker
pip install "nirs4all-aom[bench]"        # benchmark runners and reporting tools

nirs4all-aom is pure Python; no compilation is required. The optional pybaselines dependency drives aom_nirs.pls.preprocessing.ASLSBaseline.

Quick start

from sklearn.model_selection import KFold
from aom_nirs.pls import AOMPLSRegressor
from aom_nirs.ridge import AOMRidgeRegressor, AOMRidgeBlender

inner_cv = KFold(n_splits=5, shuffle=True, random_state=0)
outer_cv = KFold(n_splits=5, shuffle=True, random_state=1)

# AOM-PLS, paper "simple" preset
aom_pls = AOMPLSRegressor(
    operator_bank="compact",
    criterion="cv",
    cv=inner_cv.get_n_splits(),
    cv_splitter=inner_cv,
)
aom_pls.fit(X_train, y_train)
y_pred = aom_pls.predict(X_test)

# AOM-Ridge, fast single-estimator preset
aom_ridge = AOMRidgeRegressor(
    selection="global",
    operator_bank="compact",
    cv=inner_cv,
)
aom_ridge.fit(X_train, y_train)

# AOM-Ridge, paper "best" preset
aom_blender = AOMRidgeBlender(
    outer_cv=outer_cv,
    inner_cv=inner_cv,
)  # convex non-negative blend of Ridge candidates
aom_blender.fit(X_train, y_train)

A full reproduction of one smoke dataset for AOM-PLS, AOM-Ridge, and FastAOM is in examples/paper_smoke.py. For a user-facing split-aware tour of the full AOM family, run examples/04_aom_panoply.py. See docs/aom_panoply.md for the standalone AOM splitter guide.

Live WebAssembly demo

The AOM-PLS browser demonstration runs the portable n4m engine entirely in WebAssembly, screens its strict-linear operator bank and predicts held-out raw spectra from original-grid coefficients. Its self-contained source and staged bundle are in demo/wasm.

Relationship to other repos

  • nirs4all (GitHub) — NIRS instrumentation, acquisition, and provenance context for local benchmark inputs. The AOM methods, benchmark runners, result tables, and manuscript artifacts are distributed from this nirs4all-aom repository.
  • aompls (GitHub) — older multi-language prototype. Superseded by nirs4all-aom for the Python reference implementation used in the paper.

Paper

The manuscript and supplement live under paper/. The review dossier (paper/review/) contains the inventory, migration plan, cohort coverage audit, and per-variant score evidence used for the arXiv draft.

License

nirs4all-aom is dual-licensed open-source — CeCILL-2.1 OR AGPL-3.0-or-later (your choice) — with an optional commercial license for closed-source / SaaS use. For any commercial use, contact nirs4all-admin@cirad.fr. See LICENSING.md, the texts under LICENSES/, and THIRD_PARTY_NOTICES.md.

Citation

@software{beurier_aom_nirs_2026,
  author = {Beurier, Gregory},
  title  = {nirs4all-aom: Adaptive Operator-Mixture PLS and Ridge for NIR spectroscopy},
  year   = {2026},
  url    = {https://github.com/GBeurier/nirs4all-aom},
  version = {0.10.4}
}

Metadata

Release files for nirs4all-aom 0.10.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nirs4all-aom 0.10.4
File Size Uploaded Provenance
nirs4all_aom-0.10.4.tar.gz 273.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nirs4all-aom 0.10.4
File Interpreter ABI Platform
nirs4all_aom-0.10.4-py3-none-any.whl Python 3 none any Details

Total release size: 491.8 kB

Release files / nirs4all_aom-0.10.4.tar.gz

Download URL nirs4all_aom-0.10.4.tar.gz
Size 273.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b0c700fe4db1a57c07e1511e06c039b4bf790e4ab0338476c3135c25c78e7d4e
BLAKE2b-256 checksum
How to use checksums
c57ab878d5b362ad27786313e1b1b477e855fe0783ede8b9444e6a045393a355
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release files / nirs4all_aom-0.10.4-py3-none-any.whl

Download URL nirs4all_aom-0.10.4-py3-none-any.whl
Size 218.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
999e7b83ab78073daab3b6a718eb969ca4982aa14980845caa3828aea7715296
BLAKE2b-256 checksum
How to use checksums
a43a2ba760fe81a4fd05f37506b10ddf8736c6a48af6d250d82821c164ef97e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Security for nirs4all-aom 0.10.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nirs4all_aom-0.10.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page