Preprocessing

This section covers spectral preprocessing techniques for NIRS data.

Overview

Preprocessing is a critical step in NIRS data analysis. NIRS4ALL provides a comprehensive set of preprocessing operators that are sklearn-compatible and can be chained in pipelines.

📖 Preprocessing Overview

Comprehensive guide to available preprocessing techniques, operators, and when to use them.

Preprocessing Overview
📋 Cheatsheet

Quick reference for preprocessing selection by model type.

Preprocessing Cheatsheet
📚 Handbook

In-depth guide with theory, advanced techniques, and multi-layer preprocessing.

Preprocessing Handbook
📐 Resampling

Wavelength resampling and interpolation techniques.

Resampler - Wavelength Grid Resampling

Available Preprocessing Methods

Method

Description

Use Case

SNV

Standard Normal Variate

Scatter correction

MSC

Multiplicative Scatter Correction

Reference-based scatter correction

Derivatives

Savitzky-Golay, First/Second

Baseline removal, peak enhancement

Detrend

Polynomial detrending

Linear/quadratic baseline removal

Normalization

Min-max, area, vector

Scale standardization

Smoothing

Gaussian, moving average

Noise reduction

Quick Example

from nirs4all.operators.transforms import SNV, SavitzkyGolay

pipeline = [
    SNV(),                                    # Scatter correction
    SavitzkyGolay(window_length=15, deriv=1), # First derivative
    # ... rest of pipeline
]

See Also