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.
Comprehensive guide to available preprocessing techniques, operators, and when to use them.
Quick reference for preprocessing selection by model type.
In-depth guide with theory, advanced techniques, and multi-layer preprocessing.
Wavelength resampling and interpolation techniques.
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
Operator Catalog - Complete operator reference
Standard Normal Variate (SNV) Transformation - Detailed SNV documentation
TransferPreprocessingSelector Cheat Sheet - Transfer learning preprocessing