API

Chemometrics: A chemometrics package for Python

chemometrics is a Python module providing chemometric functionality in the Python ecosystem for scientific computing and machine learning (numpy, scipy, matplotlib, scikit-learn).

Visualisation

plot_colored_series(Y[, x, reference])

Plot lines colored by position or reference

plot_svd(D[, n_comp, n_eigenvalues])

Plot SVD-matrices in three subplots.

Preprocessing

Emsc([p_order, background, normalize, ...])

Performs extended multiplicative scatter correction (EMSC).

AsymWhittaker(penalty[, constraint_order, ...])

Background correction X with an asymmetric Whittaker filter

Whittaker([penalty, constraint_order, deriv])

Smooth X with a whittaker smoother

PLS modelling

PLSRegression([n_components, scale, ...])

PLS regression with added chemometric functionality

fit_pls(X, Y[, pipeline, cv_object, max_lv])

Auto-calibrate PLS model and generate analytical plots

Multivariate curve resolution

The chemometrics.mcr module provides Multivariate Curve Resolution - Alternating Least Squares (MCR-ALS) functionality

mcr.McrAR([c_regr, st_regr, fit_kwargs, ...])

Multivariate Curve Resolution - Alternating Regression

mcr.constraint

McrAR constraints

mcr.regressor

Built-in least squares / regression methods.

mcr.metric

Metrics used in chemometrics.mcr

Artificial data generation

generate_background(n_wl[, rel_lengthscale, ...])

Generate dummy background.

generate_data([n_wl, n_samples, n_conc, noise])

Generate artificial spectroscopic XY data without background

generate_spectra(n_wl, n_band, bandwidth)

Generate a dummy spectra with n_band