chemometrics is a free and open source library for visualization, modeling, and prediction of multivariate data.
The package streamlines chemometric workflows by providing powerful preprocessing algorithms combined with simple functional calls for generating fully calibrated chemometric models. A variety of analytical visualizations help to understand the data and build trust into the generated models. Looking for further extending the models? chemometrics is fully compatible with scikit-learn. Use advanced machine learning algorithms to get most out of your data.
The documentation is hosted at https://chemometrics.readthedocs.io
chemometrics is distributed over PyPI. The simplest way to install chemometrics is by running
python -m pip install chemometrics
Plotting with reference coloring:
import numpy as np
import matplotlib.pyplot as plt
import chemometrics as cm
plt.figure(figsize=[12, 5])
lines = cm.plot_colored_series(D.T, x=wavenumbers, reference=C[:, 1])
plt.xlabel(r'Wavenumber / $\mathrm{cm^{-1}}$')
plt.ylabel('Intensity / AU')
Preprocessing by smoothing and performing a second derivative:
X_deriv = cm.Whittaker(constraint_order=3, deriv=2).fit_transform(X)
cm.plot_colored_series(X_deriv.T, reference=Y)
plt.xlabel('Wavenumber / nm')
plt.ylabel('$d^2A/dl^2$ / $mAU/nm^2$')
A working PLS model is just one function call away:
cm.fit_pls(X_deriv, Y)
Interested in more? Check out following pages:
- Full workflow from loading the data to interpreting the calibrated PLS model
- A variety of examples
- Overview of the API
- Python >= 3.8
- NumPy >= 1.19.2
- SciPy >= 1.5.2
- scikit-learn >= 0.23.2
- matplotlib >= 3.3.2
Earlier versions of the required libraries may work but have not been tested.
chemometrics is released under GPLv3.
Copyright 2021, 2022 Matthias Rüdt