diPLSlib: A Python library for domain adaptation in multivariate calibration
diPLSlib has been created to build privacy-preserving regression models and to perform calibration model maintenance by domain adaptation. It has a scikit-learn compatible API and features following methods:
- (Multiple) Domain-invariant partial least squares regression (di-PLS/mdi-PLS)
- Graph-based calibration transfer (GCT-PLS)
- $(\epsilon, \delta)$-differentially private partial least squares regression (edPLS)
Citation: If you use this library in your research, please cite the following reference:
Nikzad-Langerodi R.(2024). diPLSlib : A Python library for domain adaptation in multivariate calibration (version 2.4.1). URL: https://di-pls.readthedocs.io/
or in Bibtex format :
@misc{nikzad2024diPLSlib,
author = {Nikzad-Langerodi, Ramin},
month = {12},
title = {diPLSlib: A Python library for domain adaptation in multivariate calibration},
url = {https://di-pls.readthedocs.io/},
year = {2024}
}
Installation
pip install diPLSlib
Quick Start
How to apply di-PLS
Train regression model
from diPLSlib.models import DIPLS
from diPLSlib.utils import misc
l = 100000 # or l = (10000, 100) Regularization
m = DIPLS(A=2, l=l)
m.fit(X, y, X_source, X_target)
# Typically X=X_source and y are the corresponding response values
Apply the model
yhat_dipls = m.predict(X_test)
err = misc.rmse(y_test, yhat_dipls)
How to apply mdi-PLS
from diPLSlib.models import DIPLS
l = 100000 # or l = (5, 100, 1000) Regularization
m = DIPLS(A=3, l=l, target_domain=2)
m.fit(X, y, X_source, X_target)
# X_target = [X1, X2, ... , Xk] is a list of target domain data
# The parameter target_domain specifies for which domain the model should be trained (here X2).
How to apply GCT-PLS
from diPLSlib.models import GCTPLS
# Training
l = 10 # or l = (10, 10) Regularization
m = GCTPLS(A=2, l=l)
m.fit(X, y, X_source, X_target)
# X_source and X_target hold the same samples measured in the source and target domain, respectively.
How to apply EDPLS
from diPLSlib.models import EDPLS
# Training
epsilon = 1 # Privacy loss
delta = 0.05 # Failure probability of the privacy guarantee
m = EDPLS(A=2, epsilon=epsilon, delta=delta)
m.fit(X, y)
How to apply KDAPLS
from diPLSlib.models import KDAPLS
# Training
model = KDAPLS(A=2, l=0.5, kernel_params={"type": "rbf", "gamma": 0.001})
model.fit(x, y, xs, xt)
Examples
For more examples, please refer to the Notebooks:
- Domain adaptation with di-PLS
- Including multiple domains (mdi-PLS)
- Implicit calibration transfer with GCT-PLS
- Model selection (with
scikit-learn) - Privacy-preserving regression with EDPLS
- Non-parametric domain adaptation with KDAPLS
Documentation
The documentation can be found here.
Acknowledgements
The first version of di-PLS was developed by Ramin Nikzad-Langerodi, Werner Zellinger, Edwin Lughofer, Bernhard Moser and Susanne Saminger-Platz and published in:
- Ramin Nikzad-Langerodi, Werner Zellinger, Edwin Lughofer, and Susanne Saminger-Platz Analytical Chemistry 2018 90 (11), 6693-6701 https://doi.org/10.1021/acs.analchem.8b00498
Further refinements to the initial algorithm were published in:
-
R. Nikzad-Langerodi, W. Zellinger, S. Saminger-Platz and B. Moser, "Domain-Invariant Regression Under Beer-Lambert's Law," 2019 18th IEEE International Conference On Machine Learning And Applications (ICMLA), Boca Raton, FL, USA, 2019, pp. 581-586, https://doi.org/10.1109/ICMLA.2019.00108.
-
Ramin Nikzad-Langerodi, Werner Zellinger, Susanne Saminger-Platz, Bernhard A. Moser, Domain adaptation for regression under Beer–Lambert’s law, Knowledge-Based Systems, Volume 210, 2020, https://doi.org/10.1016/j.knosys.2020.106447.
-
Bianca Mikulasek, Valeria Fonseca Diaz, David Gabauer, Christoph Herwig, Ramin Nikzad-Langerodi, "Partial least squares regression with multiple domains" Journal of Chemometrics 2023 37 (5), e3477, https://doi.org/10.13140/RG.2.2.23750.75845
-
Ramin Nikzad-Langerodi & Florian Sobieczky (2021). Graph‐based calibration transfer. Journal of Chemometrics, 35(4), e3319. https://doi.org/10.1002/cem.3319
-
Ramin Nikzad-Langerodi, Mohit Kumar, Du Nguyen Duy, and Mahtab Alghasi (2024), "(epsilon, delta)-Differentially Private Partial Least Squares Regression", unpublished.
Contact us
Bottleneck Analytics GmbH
info@bottleneck-analytics.com
Metadata
Release files for diPLSlib 2.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| diplslib-2.5.0.tar.gz | 33.7 kB | Without provenance | Details for diplslib-2.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| diplslib-2.5.0-py3-none-any.whl | Python 3 | none | any | Details for diplslib-2.5.0-py3-none-any.whl |
Total release size: 66.7 kB
Release files / diplslib-2.5.0.tar.gz
| Download URL | diplslib-2.5.0.tar.gz |
|---|---|
| Size | 33.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c97cd840dd9ba29238583d5682349b64b81aa9521c4b5f39eb76bbf0478ccff
|
|
BLAKE2b-256 checksum How to use checksums |
892d7e1a2fcc625ef04a3831a3887f80fb4581ad133cd9358dc3b6bb97ff2fb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.0
|
Release files / diplslib-2.5.0-py3-none-any.whl
| Download URL | diplslib-2.5.0-py3-none-any.whl |
|---|---|
| Size | 33.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70da9754b5fd1545a0300c79a439c0229c78fb0bbd6a09e8ac9341bca32b87de
|
|
BLAKE2b-256 checksum How to use checksums |
2695ec9e06d725a0e54a3f1e8063a72ef7570655968828037dfb5238021d6bbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.0
|
Security for diPLSlib 2.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.