Skip to main content

Adaptive Operator-Mixture PLS and Ridge for near-infrared spectroscopy: companion code for the paper.

Project description

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, Wilcoxon Holm-corrected $p = 2.6\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.

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.1}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nirs4all_aom-0.10.3.tar.gz (272.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nirs4all_aom-0.10.3-py3-none-any.whl (218.2 kB view details)

Uploaded Python 3

File details

Details for the file nirs4all_aom-0.10.3.tar.gz.

File metadata

  • Download URL: nirs4all_aom-0.10.3.tar.gz
  • Upload date:
  • Size: 272.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nirs4all_aom-0.10.3.tar.gz
Algorithm Hash digest
SHA256 0bf543efe78dcac3e7651a1045588d4ace886c553213093a86eb2e4a7ba3c677
MD5 1a9de964df7e26c2467b15fed3b7345f
BLAKE2b-256 7375efd42bec02090cec0d4255aad3a1b7e5fca9c6e178f89f60647efd7debe8

See more details on using hashes here.

Provenance

The following attestation bundles were made for nirs4all_aom-0.10.3.tar.gz:

Publisher: publish-pypi.yml on GBeurier/nirs4all-aom

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nirs4all_aom-0.10.3-py3-none-any.whl.

File metadata

  • Download URL: nirs4all_aom-0.10.3-py3-none-any.whl
  • Upload date:
  • Size: 218.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nirs4all_aom-0.10.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bfdb1cce54fbf1e76c1e8e31ea6987e0f9e99361c226d2d72727c4eaeaa28bec
MD5 777d590c051a294a37da9a9e1151c7f7
BLAKE2b-256 b21a4c7de6f13e6e43487b35451d272200d01dac35e4c147806108d62bb141f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for nirs4all_aom-0.10.3-py3-none-any.whl:

Publisher: publish-pypi.yml on GBeurier/nirs4all-aom

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page