package for chemometric data analysis
Project description
chemometrics
chemometrics is a free and open source chemometric library for Python. Its main focus lies on the chemometric analysis of spectroscopic data (e.g. UV/Vis, NIR, Raman, NMR and MS). chemometrics builds on scikit-learn and extends its functionalities to support chemometric data analysis. The package provides methods for plotting, preprocessing and fitting data. In contrast to scikit-learn, chemometrics is mainly intended for interactive work.
chemometrics is work in progress. The current features are mainly revolving around the (supervised) analysis of spectroscopic data.
Example applications
Plotting:
import matplotlib.pyplot as plt
import chemometrics as cm
cm.plot_colored_series(X.T, reference=Y)
plt.xlabel('Wavenumber / nm')
plt.ylabel('Absorbance / mAU')
Preprocessing:
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$')
Regression:
cm.fit_pls(X_deriv, Y)
More examples with explanations and additional code are shown in the examples folder. For an initial overview of a typical regression workflow, a look at this example might be most interesting (the example Jupyter Notebooks are not always rendered correctly by Github. They may be displayed by copying the url to https://nbviewer.jupyter.org/).
Requirements and installation
- 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 distributed over PyPI. The simplest way to install chemometrics is by running
python -m pip install chemometrics
The source code is available from: https://github.com/maruedt/chemometrics.
Code quality, testing and future development
chemometrics is written with a strong focus on code quality in mind. The first implementation of many similar functionalities was done in Matlab but chemometrics has since been rewritten from scratch to omit licensing issues and to provide an improved and coherent code structure. The code includes quite an extensive set of unit tests to ensure that it actually does what it is supposed to do. Next to ensuring that the code runs, the tests aim to mathematically ensure the correctness of the different procedures.
As mentioned above, chemometrics is work in progress. I will be working on integrating additional analytical methods and provide more of the common tools/plots used in chemometrics. This may include:
- Summary statistics/plots for PCA
- Further develop the already available tools for PLS models
- Potentially MCR
Nomenclature
chemometrics generally complies with the glossary of scikit-learn: https://scikit-learn.org/stable/glossary.html
Copyright
Copyright 2021 Matthias Rüdt
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for chemometrics-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26de134f269785f5d2bc7fa74c84511fd62de9354b330338bfb215a18b544fb3 |
|
MD5 | a329a328aef45d28c3ae9e1fb837a2ec |
|
BLAKE2b-256 | 8bd283371b30ef30cac3957285b706e1e807c5485e044a49da32b42c0e9c48ac |