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, ...])

Perform extended multiplicative scatter correction (EMSC)

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

Background correction X with an asymmetric Whittaker filter

Whittaker([penalty, constraint_order, deriv])

Smooth with a Whittaker filter

Decomposition

PCA([n_components, copy, whiten, ...])

Principal component analysis with added chemometric functionality

fit_pca(X[, pipeline, cv_object, max_lv])

Auto-calibrate PCA model and generate analytical plots

Regression

PLSRegression([n_components, max_iter, tol, ...])

PLS regression with added chemometric functionality

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

Auto-calibrate PLS model and generate analytical plots

IHM(features, peak_parameters[, bl_order, ...])

Indirect Hard Modeling (IHM) without linear regression

IHMRegression(features, peak_parameters[, ...])

Indirect Hard Modeling (IHM) of spectra with OLS prediction

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

pseudo_voigt_spectra(x, parameter)

Generates vector based on pseudo-Voigt profiles