All modules for which code is available
71 |- diPLSlib.functions 72 |
- diPLSlib.models 73 |
- diPLSlib.utils.misc 74 |
├── diPLSlib ├── __init__.py ├── utils │ ├── __init__.py │ └── misc.py └── __pycache__ │ ├── dipals.cpython-313.pyc │ ├── __init__.cpython-313.pyc │ └── functions.cpython-313.pyc ├── diPLSlib.egg-info ├── dependency_links.txt ├── top_level.txt ├── requires.txt ├── SOURCES.txt └── PKG-INFO ├── demo.png ├── data └── corn.mat ├── doc ├── modules.rst ├── _build │ ├── html │ │ ├── objects.inv │ │ ├── _static │ │ │ ├── file.png │ │ │ ├── minus.png │ │ │ ├── plus.png │ │ │ ├── css │ │ │ │ ├── fonts │ │ │ │ │ ├── lato-bold.woff │ │ │ │ │ ├── lato-bold.woff2 │ │ │ │ │ ├── lato-normal.woff │ │ │ │ │ ├── lato-normal.woff2 │ │ │ │ │ ├── Roboto-Slab-Bold.woff │ │ │ │ │ ├── Roboto-Slab-Bold.woff2 │ │ │ │ │ ├── lato-bold-italic.woff │ │ │ │ │ ├── lato-bold-italic.woff2 │ │ │ │ │ ├── Roboto-Slab-Regular.woff │ │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ │ ├── lato-normal-italic.woff │ │ │ │ │ ├── lato-normal-italic.woff2 │ │ │ │ │ ├── Roboto-Slab-Regular.woff2 │ │ │ │ │ └── fontawesome-webfont.woff2 │ │ │ │ └── badge_only.css │ │ │ ├── fonts │ │ │ │ ├── Lato │ │ │ │ │ ├── lato-bold.eot │ │ │ │ │ ├── lato-bold.ttf │ │ │ │ │ ├── lato-bold.woff │ │ │ │ │ ├── lato-bold.woff2 │ │ │ │ │ ├── lato-italic.eot │ │ │ │ │ ├── lato-italic.ttf │ │ │ │ │ ├── lato-italic.woff │ │ │ │ │ ├── lato-regular.eot │ │ │ │ │ ├── lato-regular.ttf │ │ │ │ │ ├── lato-italic.woff2 │ │ │ │ │ ├── lato-regular.woff │ │ │ │ │ ├── lato-regular.woff2 │ │ │ │ │ ├── lato-bolditalic.eot │ │ │ │ │ ├── lato-bolditalic.ttf │ │ │ │ │ ├── lato-bolditalic.woff │ │ │ │ │ └── lato-bolditalic.woff2 │ │ │ │ └── RobotoSlab │ │ │ │ │ ├── roboto-slab-v7-bold.eot │ │ │ │ │ ├── roboto-slab-v7-bold.ttf │ │ │ │ │ ├── roboto-slab-v7-bold.woff │ │ │ │ │ ├── roboto-slab-v7-bold.woff2 │ │ │ │ │ ├── roboto-slab-v7-regular.eot │ │ │ │ │ ├── roboto-slab-v7-regular.ttf │ │ │ │ │ ├── roboto-slab-v7-regular.woff │ │ │ │ │ └── roboto-slab-v7-regular.woff2 │ │ │ ├── documentation_options.js │ │ │ ├── js │ │ │ │ ├── badge_only.js │ │ │ │ ├── theme.js │ │ │ │ └── versions.js │ │ │ ├── _sphinx_javascript_frameworks_compat.js │ │ │ ├── doctools.js │ │ │ ├── pygments.css │ │ │ ├── language_data.js │ │ │ ├── sphinx_highlight.js │ │ │ ├── basic.css │ │ │ └── searchtools.js │ │ ├── _sources │ │ │ ├── modules.rst.txt │ │ │ ├── diPLSlib.utils.rst.txt │ │ │ ├── diPLSlib.rst.txt │ │ │ └── index.rst.txt │ │ ├── .buildinfo │ │ ├── .buildinfo.bak │ │ ├── _modules │ │ │ └── index.html │ │ ├── search.html │ │ ├── py-modindex.html │ │ ├── index.html │ │ ├── modules.html │ │ ├── searchindex.js │ │ ├── genindex.html │ │ └── diPLSlib.utils.html │ └── doctrees │ │ ├── index.doctree │ │ ├── diPLSlib.doctree │ │ ├── modules.doctree │ │ ├── environment.pickle │ │ └── diPLSlib.utils.doctree ├── diPLSlib.utils.rst ├── diPLSlib.rst ├── Makefile ├── make.bat ├── conf.py └── index.rst ├── __pycache__ ├── dipals.cpython-39.pyc ├── functions.cpython-39.pyc └── demo_mdiPLS.cpython-313.pyc ├── requirements.txt ├── .gitignore ├── setup.py ├── .readthedocs.yaml ├── tests └── test_doctests.py ├── changelog.md └── README.md /diPLSlib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /diPLSlib/utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /diPLSlib.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /diPLSlib.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | diPLSlib 2 | -------------------------------------------------------------------------------- /demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/demo.png -------------------------------------------------------------------------------- /data/corn.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/data/corn.mat -------------------------------------------------------------------------------- /diPLSlib.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | matplotlib 3 | scipy 4 | scikit-learn 5 | -------------------------------------------------------------------------------- /doc/modules.rst: -------------------------------------------------------------------------------- 1 | diPLSlib 2 | ======== 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | diPLSlib 8 | -------------------------------------------------------------------------------- /doc/_build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/objects.inv -------------------------------------------------------------------------------- /__pycache__/dipals.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/__pycache__/dipals.cpython-39.pyc -------------------------------------------------------------------------------- /doc/_build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/doctrees/index.doctree -------------------------------------------------------------------------------- /doc/_build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/file.png -------------------------------------------------------------------------------- /doc/_build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/minus.png -------------------------------------------------------------------------------- /doc/_build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/plus.png -------------------------------------------------------------------------------- /__pycache__/functions.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/__pycache__/functions.cpython-39.pyc -------------------------------------------------------------------------------- /doc/_build/doctrees/diPLSlib.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/doctrees/diPLSlib.doctree -------------------------------------------------------------------------------- /doc/_build/doctrees/modules.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/doctrees/modules.doctree -------------------------------------------------------------------------------- /doc/_build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/doctrees/environment.pickle -------------------------------------------------------------------------------- /doc/_build/html/_sources/modules.rst.txt: -------------------------------------------------------------------------------- 1 | diPLSlib 2 | ======== 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | diPLSlib 8 | -------------------------------------------------------------------------------- /__pycache__/demo_mdiPLS.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/__pycache__/demo_mdiPLS.cpython-313.pyc -------------------------------------------------------------------------------- /diPLSlib/__pycache__/dipals.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/diPLSlib/__pycache__/dipals.cpython-313.pyc -------------------------------------------------------------------------------- /doc/_build/doctrees/diPLSlib.utils.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/doctrees/diPLSlib.utils.doctree -------------------------------------------------------------------------------- /diPLSlib/__pycache__/__init__.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/diPLSlib/__pycache__/__init__.cpython-313.pyc -------------------------------------------------------------------------------- /diPLSlib/__pycache__/functions.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/diPLSlib/__pycache__/functions.cpython-313.pyc -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/lato-bold.woff -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-bold.eot -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-bold.ttf -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/lato-bold.woff2 -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/lato-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/lato-normal.woff -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/lato-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/lato-normal.woff2 -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-bold.woff -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-bold.woff2 -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-italic.eot -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-italic.ttf -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-italic.woff -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-regular.eot -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-regular.ttf -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-italic.woff2 -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-regular.woff -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-regular.woff2 -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/lato-bold-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/lato-bold-italic.woff -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/lato-bold-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/lato-bold-italic.woff2 -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-bolditalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-bolditalic.eot -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-bolditalic.ttf -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-bolditalic.woff -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/Lato/lato-bolditalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/Lato/lato-bolditalic.woff2 -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/lato-normal-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/lato-normal-italic.woff -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/lato-normal-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/lato-normal-italic.woff2 -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 -------------------------------------------------------------------------------- /doc/_build/html/_static/css/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/css/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff -------------------------------------------------------------------------------- /doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/B-Analytics/diPLSlib/HEAD/doc/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | matplotlib==3.9.2 2 | numpy==2.1.3 3 | scikit_learn==1.5.2 4 | scipy==1.14.1 5 | setuptools==75.1.0 6 | numpydoc==1.8.0 7 | sphinx==8.1.3 8 | sphinx_rtd_theme==3.0.1 9 | -------------------------------------------------------------------------------- /doc/_build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file records the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: c06bbb0eaad82c518ef5e37c9765238d 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /doc/_build/html/.buildinfo.bak: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file records the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: a9ab0143384d0957b09b608e96947e9c 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Python bytecode files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # Ignore virtual environment directories 6 | venv/ 7 | env/ 8 | 9 | # Ignore distribution files 10 | dist/ 11 | build/ 12 | *.egg-info/ 13 | 14 | # Ignore the .env file 15 | .env 16 | 17 | # ignore the release notes file 18 | .release_notes.md 19 | 20 | # Ignore the contributing file 21 | .contributing.md 22 | -------------------------------------------------------------------------------- /diPLSlib.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | LICENSE 2 | README.md 3 | setup.py 4 | diPLSlib/__init__.py 5 | diPLSlib/functions.py 6 | diPLSlib/models.py 7 | diPLSlib.egg-info/PKG-INFO 8 | diPLSlib.egg-info/SOURCES.txt 9 | diPLSlib.egg-info/dependency_links.txt 10 | diPLSlib.egg-info/requires.txt 11 | diPLSlib.egg-info/top_level.txt 12 | diPLSlib/utils/__init__.py 13 | diPLSlib/utils/misc.py 14 | tests/test_doctests.py -------------------------------------------------------------------------------- /doc/_build/html/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | const DOCUMENTATION_OPTIONS = { 2 | VERSION: '2.5.0', 3 | LANGUAGE: 'en', 4 | COLLAPSE_INDEX: false, 5 | BUILDER: 'html', 6 | FILE_SUFFIX: '.html', 7 | LINK_SUFFIX: '.html', 8 | HAS_SOURCE: true, 9 | SOURCELINK_SUFFIX: '.txt', 10 | NAVIGATION_WITH_KEYS: false, 11 | SHOW_SEARCH_SUMMARY: true, 12 | ENABLE_SEARCH_SHORTCUTS: true, 13 | }; -------------------------------------------------------------------------------- /doc/diPLSlib.utils.rst: -------------------------------------------------------------------------------- 1 | diPLSlib.utils subpackage 2 | ========================= 3 | 4 | 5 | diPLSlib.utils.misc module 6 | -------------------------- 7 | 8 | .. automodule:: diPLSlib.utils.misc 9 | :members: 10 | :undoc-members: 11 | :show-inheritance: 12 | 13 | Module contents 14 | --------------- 15 | 16 | .. automodule:: diPLSlib.utils 17 | :members: 18 | :undoc-members: 19 | :show-inheritance: 20 | -------------------------------------------------------------------------------- /doc/_build/html/_sources/diPLSlib.utils.rst.txt: -------------------------------------------------------------------------------- 1 | diPLSlib.utils subpackage 2 | ========================= 3 | 4 | 5 | diPLSlib.utils.misc module 6 | -------------------------- 7 | 8 | .. automodule:: diPLSlib.utils.misc 9 | :members: 10 | :undoc-members: 11 | :show-inheritance: 12 | 13 | Module contents 14 | --------------- 15 | 16 | .. automodule:: diPLSlib.utils 17 | :members: 18 | :undoc-members: 19 | :show-inheritance: 20 | -------------------------------------------------------------------------------- /doc/diPLSlib.rst: -------------------------------------------------------------------------------- 1 | diPLSlib package 2 | ================ 3 | 4 | 5 | diPLSlib.functions module 6 | ------------------------- 7 | 8 | .. automodule:: diPLSlib.functions 9 | :members: 10 | :undoc-members: 11 | :show-inheritance: 12 | 13 | diPLSlib.models module 14 | ---------------------- 15 | 16 | .. automodule:: diPLSlib.models 17 | :members: 18 | :undoc-members: 19 | :show-inheritance: 20 | 21 | diPLSlib.utils subpackage 22 | ------------------------- 23 | 24 | .. toctree:: 25 | :maxdepth: 4 26 | 27 | diPLSlib.utils 28 | 29 | Module contents 30 | --------------- 31 | 32 | .. automodule:: diPLSlib 33 | :members: 34 | :undoc-members: 35 | :show-inheritance: 36 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /doc/_build/html/_sources/diPLSlib.rst.txt: -------------------------------------------------------------------------------- 1 | diPLSlib package 2 | ================ 3 | 4 | 5 | diPLSlib.functions module 6 | ------------------------- 7 | 8 | .. automodule:: diPLSlib.functions 9 | :members: 10 | :undoc-members: 11 | :show-inheritance: 12 | 13 | diPLSlib.models module 14 | ---------------------- 15 | 16 | .. automodule:: diPLSlib.models 17 | :members: 18 | :undoc-members: 19 | :show-inheritance: 20 | 21 | diPLSlib.utils subpackage 22 | ------------------------- 23 | 24 | .. toctree:: 25 | :maxdepth: 4 26 | 27 | diPLSlib.utils 28 | 29 | Module contents 30 | --------------- 31 | 32 | .. automodule:: diPLSlib 33 | :members: 34 | :undoc-members: 35 | :show-inheritance: 36 | -------------------------------------------------------------------------------- /doc/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | %SPHINXBUILD% >NUL 2>NUL 14 | if errorlevel 9009 ( 15 | echo. 16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 17 | echo.installed, then set the SPHINXBUILD environment variable to point 18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 19 | echo.may add the Sphinx directory to PATH. 20 | echo. 21 | echo.If you don't have Sphinx installed, grab it from 22 | echo.https://www.sphinx-doc.org/ 23 | exit /b 1 24 | ) 25 | 26 | if "%1" == "" goto help 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /doc/_build/html/_static/js/badge_only.js: -------------------------------------------------------------------------------- 1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}({4:function(e,t,r){}}); -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | with open("README.md", "r", encoding="utf-8") as fh: 4 | long_description = fh.read() 5 | 6 | setuptools.setup( 7 | name="diPLSlib", 8 | version="2.5.0", 9 | author="Ramin Nikzad-Langerodi", 10 | author_email="ramin.nikzad-langerodi@scch.at", 11 | description="Python package for domain adaptation in multivariate regression", 12 | long_description=long_description, 13 | long_description_content_type="text/markdown", 14 | url="https://github.com/B-Analytics/di-PLS", 15 | packages=setuptools.find_packages(), 16 | classifiers=[ 17 | "Programming Language :: Python :: 3", 18 | 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 19 | "Operating System :: OS Independent", 20 | ], 21 | python_requires='>=3.6', 22 | install_requires=[ 23 | 'numpy', 24 | 'matplotlib', 25 | 'scipy', 26 | 'scikit-learn', 27 | ] 28 | ) -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file for Sphinx projects 2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 3 | 4 | # Required 5 | version: 2 6 | 7 | # Set the OS, Python version and other tools you might need 8 | build: 9 | os: ubuntu-22.04 10 | tools: 11 | python: "3.12" 12 | # You can also specify other tool versions: 13 | # nodejs: "20" 14 | # rust: "1.70" 15 | # golang: "1.20" 16 | 17 | # Build documentation in the "docs/" directory with Sphinx 18 | sphinx: 19 | configuration: doc/conf.py 20 | # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs 21 | # builder: "dirhtml" 22 | # Fail on all warnings to avoid broken references 23 | # fail_on_warning: true 24 | # Optionally build your docs in additional formats such as PDF and ePub 25 | # formats: 26 | # - pdf 27 | # - epub 28 | 29 | # Optional but recommended, declare the Python requirements required 30 | # to build your documentation 31 | # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html 32 | python: 33 | install: 34 | - requirements: requirements.txt 35 | -------------------------------------------------------------------------------- /doc/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # For the full list of built-in configuration values, see the documentation: 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 5 | 6 | import os 7 | import sys 8 | sys.path.insert(0, os.path.abspath('../')) 9 | 10 | # -- Project information ----------------------------------------------------- 11 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information 12 | 13 | project = 'diPLSlib' 14 | copyright = '2025, Ramin Nikzad-Langerodi' 15 | author = 'Ramin Nikzad-Langerodi' 16 | release = '2.5.0' 17 | 18 | # -- General configuration --------------------------------------------------- 19 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration 20 | 21 | extensions = [ 22 | 'sphinx.ext.autodoc', 23 | 'numpydoc', 24 | 'sphinx.ext.viewcode', 25 | 'sphinx.ext.mathjax'] 26 | #'sphinx.ext.napoleon'] 27 | 28 | templates_path = ['_templates'] 29 | exclude_patterns = [] 30 | 31 | 32 | 33 | # -- Options for HTML output ------------------------------------------------- 34 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output 35 | 36 | html_theme = 'sphinx_rtd_theme' 37 | html_static_path = ['_static'] 38 | -------------------------------------------------------------------------------- /doc/index.rst: -------------------------------------------------------------------------------- 1 | .. diPLSlib documentation master file, created by 2 | sphinx-quickstart on Sun Nov 3 00:13:47 2024. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | diPLSlib documentation 7 | ====================== 8 | 9 | Introduction 10 | ------------ 11 | 12 | **diPLSlib** is a Python library designed for domain adaptation in multivariate calibration, with a focus on privacy-preserving regression and calibration model maintenance. It provides a scikit-learn compatible API and implements advanced methods for aligning data distributions across different domains, enabling robust and transferable regression models. 13 | 14 | The library features several state-of-the-art algorithms, including: 15 | 16 | - **Domain-Invariant Partial Least Squares (di-PLS/mdi-PLS):** Aligns feature distributions between source and target domains to improve model generalization. 17 | - **Graph-based Calibration Transfer (GCT-PLS):** Minimizes discrepancies between paired samples from different domains in the latent variable space. 18 | - **Kernel Domain Adaptive PLS (KDAPLS):** Projects data into a reproducing kernel Hilbert space for non-parametric domain adaptation. 19 | - **Differentially Private PLS (EDPLS):** Ensures privacy guarantees for sensitive data using the :math:`(\epsilon, \delta)`-differential privacy framework. 20 | 21 | diPLSlib is suitable for chemometrics, analytical chemistry, and other fields where robust calibration transfer and privacy-preserving modeling are required. For more details, usage examples, and API documentation, please refer to the sections below. 22 | 23 | .. toctree:: 24 | :maxdepth: 2 25 | :caption: Contents: 26 | 27 | diPLSlib 28 | -------------------------------------------------------------------------------- /doc/_build/html/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. diPLSlib documentation master file, created by 2 | sphinx-quickstart on Sun Nov 3 00:13:47 2024. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | diPLSlib documentation 7 | ====================== 8 | 9 | Introduction 10 | ------------ 11 | 12 | **diPLSlib** is a Python library designed for domain adaptation in multivariate calibration, with a focus on privacy-preserving regression and calibration model maintenance. It provides a scikit-learn compatible API and implements advanced methods for aligning data distributions across different domains, enabling robust and transferable regression models. 13 | 14 | The library features several state-of-the-art algorithms, including: 15 | 16 | - **Domain-Invariant Partial Least Squares (di-PLS/mdi-PLS):** Aligns feature distributions between source and target domains to improve model generalization. 17 | - **Graph-based Calibration Transfer (GCT-PLS):** Minimizes discrepancies between paired samples from different domains in the latent variable space. 18 | - **Kernel Domain Adaptive PLS (KDAPLS):** Projects data into a reproducing kernel Hilbert space for non-parametric domain adaptation. 19 | - **Differentially Private PLS (EDPLS):** Ensures privacy guarantees for sensitive data using the :math:`(\epsilon, \delta)`-differential privacy framework. 20 | 21 | diPLSlib is suitable for chemometrics, analytical chemistry, and other fields where robust calibration transfer and privacy-preserving modeling are required. For more details, usage examples, and API documentation, please refer to the sections below. 22 | 23 | .. toctree:: 24 | :maxdepth: 2 25 | :caption: Contents: 26 | 27 | diPLSlib 28 | -------------------------------------------------------------------------------- /tests/test_doctests.py: -------------------------------------------------------------------------------- 1 | import doctest 2 | import unittest 3 | import diPLSlib.models 4 | import diPLSlib.functions 5 | import diPLSlib.utils.misc 6 | from sklearn.utils.estimator_checks import check_estimator 7 | from diPLSlib.models import DIPLS, GCTPLS, EDPLS, KDAPLS 8 | import nbformat 9 | from nbconvert.preprocessors import ExecutePreprocessor 10 | import os 11 | 12 | class TestDocstrings(unittest.TestCase): 13 | 14 | # Test if all docstring examples run without errors 15 | def test_docstrings(self): 16 | 17 | # Run doctests across all modules in your_package 18 | doctest.testmod(diPLSlib.models) 19 | doctest.testmod(diPLSlib.functions) 20 | doctest.testmod(diPLSlib.utils.misc) 21 | 22 | # Test if diPLSlib.model classes pass check_estimator 23 | def test_check_estimator(self): 24 | 25 | models = [ 26 | DIPLS(), 27 | GCTPLS(), 28 | EDPLS(A=2, epsilon=1.0, delta=0.05), # Add required parameters for EDPLS 29 | KDAPLS() 30 | ] 31 | 32 | for model in models: 33 | check_estimator(model) 34 | 35 | 36 | # Test if all notebooks run without errors 37 | def test_notebooks(self): 38 | # List of notebooks to test 39 | notebooks = [ 40 | './notebooks/demo_diPLS.ipynb', 41 | './notebooks/demo_mdiPLS.ipynb', 42 | './notebooks/demo_gctPLS.ipynb', 43 | './notebooks/demo_edPLS.ipynb', 44 | './notebooks/demo_daPLS.ipynb', 45 | ] 46 | 47 | for notebook in notebooks: 48 | with open(notebook) as f: 49 | nb = nbformat.read(f, as_version=4) 50 | ep = ExecutePreprocessor(timeout=600, kernel_name='python3') 51 | 52 | # Set the working directory to the root of the project 53 | root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) 54 | os.chdir(root_dir) 55 | 56 | ep.preprocess(nb, {'metadata': {'path': './notebooks/'}}) 57 | 58 | 59 | if __name__ == '__main__': 60 | unittest.main() -------------------------------------------------------------------------------- /doc/_build/html/_static/css/badge_only.css: -------------------------------------------------------------------------------- 1 | .clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions .rst-other-versions .rtd-current-item{font-weight:700}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}#flyout-search-form{padding:6px} -------------------------------------------------------------------------------- /doc/_build/html/_modules/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 || 83 | d | ||
| 87 | |
88 | diPLSlib | 89 | |
| 92 | |
93 | diPLSlib.functions | 94 | |
| 97 | |
98 | diPLSlib.models | 99 | |
| 102 | |
103 | diPLSlib.utils | 104 | |
| 107 | |
108 | diPLSlib.utils.misc | 109 | |
' + 111 | '' + 112 | _("Hide Search Matches") + 113 | "
" 114 | ) 115 | ); 116 | }, 117 | 118 | /** 119 | * helper function to hide the search marks again 120 | */ 121 | hideSearchWords: () => { 122 | document 123 | .querySelectorAll("#searchbox .highlight-link") 124 | .forEach((el) => el.remove()); 125 | document 126 | .querySelectorAll("span.highlighted") 127 | .forEach((el) => el.classList.remove("highlighted")); 128 | localStorage.removeItem("sphinx_highlight_terms") 129 | }, 130 | 131 | initEscapeListener: () => { 132 | // only install a listener if it is really needed 133 | if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; 134 | 135 | document.addEventListener("keydown", (event) => { 136 | // bail for input elements 137 | if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; 138 | // bail with special keys 139 | if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; 140 | if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { 141 | SphinxHighlight.hideSearchWords(); 142 | event.preventDefault(); 143 | } 144 | }); 145 | }, 146 | }; 147 | 148 | _ready(() => { 149 | /* Do not call highlightSearchWords() when we are on the search page. 150 | * It will highlight words from the *previous* search query. 151 | */ 152 | if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); 153 | SphinxHighlight.initEscapeListener(); 154 | }); 155 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # diPLSlib: A Python library for domain adaptation in multivariate calibration 2 | 3 |  4 |  5 | 6 |  7 | 8 | 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: 9 | 10 | - (Multiple) Domain-invariant partial least squares regression (di-PLS/mdi-PLS) 11 | - Graph-based calibration transfer (GCT-PLS) 12 | - $(\epsilon, \delta)$-differentially private partial least squares regression (edPLS) 13 | 14 | **Citation**: If you use this library in your research, please cite the following reference: 15 | 16 | ``` 17 | Nikzad-Langerodi R.(2024). diPLSlib : A Python library for domain adaptation in multivariate calibration (version 2.4.1). URL: https://di-pls.readthedocs.io/ 18 | ``` 19 | or in Bibtex format : 20 | ```bibtex 21 | @misc{nikzad2024diPLSlib, 22 | author = {Nikzad-Langerodi, Ramin}, 23 | month = {12}, 24 | title = {diPLSlib: A Python library for domain adaptation in multivariate calibration}, 25 | url = {https://di-pls.readthedocs.io/}, 26 | year = {2024} 27 | } 28 | ``` 29 | 30 | # Installation 31 | ```bash 32 | pip install diPLSlib 33 | ``` 34 | 35 | # Quick Start 36 | ## How to apply di-PLS 37 | Train regression model 38 | ```python 39 | from diPLSlib.models import DIPLS 40 | from diPLSlib.utils import misc 41 | 42 | l = 100000 # or l = (10000, 100) Regularization 43 | m = DIPLS(A=2, l=l) 44 | m.fit(X, y, X_source, X_target) 45 | 46 | # Typically X=X_source and y are the corresponding response values 47 | ``` 48 | Apply the model 49 | ```python 50 | yhat_dipls = m.predict(X_test) 51 | err = misc.rmse(y_test, yhat_dipls) 52 | ``` 53 | 54 | ## How to apply mdi-PLS 55 | ```python 56 | from diPLSlib.models import DIPLS 57 | 58 | l = 100000 # or l = (5, 100, 1000) Regularization 59 | m = DIPLS(A=3, l=l, target_domain=2) 60 | m.fit(X, y, X_source, X_target) 61 | 62 | # X_target = [X1, X2, ... , Xk] is a list of target domain data 63 | # The parameter target_domain specifies for which domain the model should be trained (here X2). 64 | ``` 65 | 66 | ## How to apply GCT-PLS 67 | ```python 68 | from diPLSlib.models import GCTPLS 69 | 70 | # Training 71 | l = 10 # or l = (10, 10) Regularization 72 | m = GCTPLS(A=2, l=l) 73 | m.fit(X, y, X_source, X_target) 74 | 75 | # X_source and X_target hold the same samples measured in the source and target domain, respectively. 76 | ``` 77 | 78 | ## How to apply EDPLS 79 | ```python 80 | from diPLSlib.models import EDPLS 81 | 82 | # Training 83 | epsilon = 1 # Privacy loss 84 | delta = 0.05 # Failure probability of the privacy guarantee 85 | m = EDPLS(A=2, epsilon=epsilon, delta=delta) 86 | m.fit(X, y) 87 | ``` 88 | 89 | ## How to apply KDAPLS 90 | ```python 91 | from diPLSlib.models import KDAPLS 92 | 93 | # Training 94 | model = KDAPLS(A=2, l=0.5, kernel_params={"type": "rbf", "gamma": 0.001}) 95 | model.fit(x, y, xs, xt) 96 | ``` 97 | 98 | ## Examples 99 | For more examples, please refer to the [Notebooks](notebooks): 100 | 101 | - [Domain adaptation with di-PLS](https://github.com/B-Analytics/diPLSlib/blob/main/notebooks/demo_diPLS.ipynb) 102 | - [Including multiple domains (mdi-PLS)](https://github.com/B-Analytics/diPLSlib/blob/main/notebooks/demo_mdiPLS.ipynb) 103 | - [Implicit calibration transfer with GCT-PLS](https://github.com/B-Analytics/diPLSlib/blob/main/notebooks/demo_gctPLS.ipynb) 104 | - [Model selection (with `scikit-learn`)](https://github.com/B-Analytics/diPLSlib/blob/main/notebooks/demo_ModelSelection.ipynb) 105 | - [Privacy-preserving regression with EDPLS](https://github.com/B-Analytics/diPLSlib/blob/main/notebooks/demo_edPLS.ipynb) 106 | - [Non-parametric domain adaptation with KDAPLS](https://github.com/B-Analytics/diPLSlib/blob/main/notebooks/demo_daPLS.ipynb) 107 | 108 | # Documentation 109 | The documentation can be found [here](https://di-pls.readthedocs.io/en/latest/diPLSlib.html). 110 | 111 | # Acknowledgements 112 | The first version of di-PLS was developed by Ramin Nikzad-Langerodi, Werner Zellinger, Edwin Lughofer, Bernhard Moser and Susanne Saminger-Platz 113 | and published in: 114 | 115 | - *Ramin Nikzad-Langerodi, Werner Zellinger, Edwin Lughofer, and Susanne Saminger-Platz 116 | Analytical Chemistry 2018 90 (11), 6693-6701 https://doi.org/10.1021/acs.analchem.8b00498* 117 | 118 | Further refinements to the initial algorithm were published in: 119 | 120 | - *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.* 121 | 122 | - *Ramin Nikzad-Langerodi, Werner Zellinger, Susanne Saminger-Platz, Bernhard A. Moser, 123 | Domain adaptation for regression under Beer–Lambert’s law, 124 | Knowledge-Based Systems, Volume 210, 2020, https://doi.org/10.1016/j.knosys.2020.106447.* 125 | 126 | - *Bianca Mikulasek, Valeria Fonseca Diaz, David Gabauer, Christoph Herwig, Ramin Nikzad-Langerodi, 127 | "Partial least squares regression with multiple domains" Journal of Chemometrics 2023 37 (5), e3477, https://doi.org/10.13140/RG.2.2.23750.75845* 128 | 129 | - *Ramin Nikzad-Langerodi & Florian Sobieczky (2021). Graph‐based calibration transfer. Journal of Chemometrics, 35(4), e3319. https://doi.org/10.1002/cem.3319* 130 | 131 | - *Ramin Nikzad-Langerodi, Mohit Kumar, Du Nguyen Duy, and Mahtab Alghasi (2024), "(epsilon, delta)-Differentially Private Partial Least Squares Regression", unpublished.* 132 | 133 | # Contact us 134 | Bottleneck Analytics GmbH 135 | info@bottleneck-analytics.com 136 | 137 | -------------------------------------------------------------------------------- /diPLSlib.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 2.1 2 | Name: diPLSlib 3 | Version: 2.5.0 4 | Summary: Python package for domain adaptation in multivariate regression 5 | Home-page: https://github.com/B-Analytics/di-PLS 6 | Author: Ramin Nikzad-Langerodi 7 | Author-email: ramin.nikzad-langerodi@scch.at 8 | Classifier: Programming Language :: Python :: 3 9 | Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3) 10 | Classifier: Operating System :: OS Independent 11 | Requires-Python: >=3.6 12 | Description-Content-Type: text/markdown 13 | License-File: LICENSE 14 | Requires-Dist: numpy 15 | Requires-Dist: matplotlib 16 | Requires-Dist: scipy 17 | Requires-Dist: scikit-learn 18 | 19 | # diPLSlib: A Python library for domain adaptation in multivariate calibration 20 | 21 |  22 |  23 | 24 |  25 | 26 | 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: 27 | 28 | - (Multiple) Domain-invariant partial least squares regression (di-PLS/mdi-PLS) 29 | - Graph-based calibration transfer (GCT-PLS) 30 | - $(\epsilon, \delta)$-differentially private partial least squares regression (edPLS) 31 | 32 | **Citation**: If you use this library in your research, please cite the following reference: 33 | 34 | ``` 35 | Nikzad-Langerodi R.(2024). diPLSlib : A Python library for domain adaptation in multivariate calibration (version 2.4.1). URL: https://di-pls.readthedocs.io/ 36 | ``` 37 | or in Bibtex format : 38 | ```bibtex 39 | @misc{nikzad2024diPLSlib, 40 | author = {Nikzad-Langerodi, Ramin}, 41 | month = {12}, 42 | title = {diPLSlib: A Python library for domain adaptation in multivariate calibration}, 43 | url = {https://di-pls.readthedocs.io/}, 44 | year = {2024} 45 | } 46 | ``` 47 | 48 | # Installation 49 | ```bash 50 | pip install diPLSlib 51 | ``` 52 | 53 | # Quick Start 54 | ## How to apply di-PLS 55 | Train regression model 56 | ```python 57 | from diPLSlib.models import DIPLS 58 | from diPLSlib.utils import misc 59 | 60 | l = 100000 # or l = (10000, 100) Regularization 61 | m = DIPLS(A=2, l=l) 62 | m.fit(X, y, X_source, X_target) 63 | 64 | # Typically X=X_source and y are the corresponding response values 65 | ``` 66 | Apply the model 67 | ```python 68 | yhat_dipls = m.predict(X_test) 69 | err = misc.rmse(y_test, yhat_dipls) 70 | ``` 71 | 72 | ## How to apply mdi-PLS 73 | ```python 74 | from diPLSlib.models import DIPLS 75 | 76 | l = 100000 # or l = (5, 100, 1000) Regularization 77 | m = DIPLS(A=3, l=l, target_domain=2) 78 | m.fit(X, y, X_source, X_target) 79 | 80 | # X_target = [X1, X2, ... , Xk] is a list of target domain data 81 | # The parameter target_domain specifies for which domain the model should be trained (here X2). 82 | ``` 83 | 84 | ## How to apply GCT-PLS 85 | ```python 86 | from diPLSlib.models import GCTPLS 87 | 88 | # Training 89 | l = 10 # or l = (10, 10) Regularization 90 | m = GCTPLS(A=2, l=l) 91 | m.fit(X, y, X_source, X_target) 92 | 93 | # X_source and X_target hold the same samples measured in the source and target domain, respectively. 94 | ``` 95 | 96 | ## How to apply EDPLS 97 | ```python 98 | from diPLSlib.models import EDPLS 99 | 100 | # Training 101 | epsilon = 1 # Privacy loss 102 | delta = 0.05 # Failure probability of the privacy guarantee 103 | m = EDPLS(A=2, epsilon=epsilon, delta=delta) 104 | m.fit(X, y) 105 | ``` 106 | 107 | ## How to apply KDAPLS 108 | ```python 109 | from diPLSlib.models import KDAPLS 110 | 111 | # Training 112 | model = KDAPLS(A=2, l=0.5, kernel_params={"type": "rbf", "gamma": 0.001}) 113 | model.fit(x, y, xs, xt) 114 | ``` 115 | 116 | ## Examples 117 | For more examples, please refer to the [Notebooks](notebooks): 118 | 119 | - [Domain adaptation with di-PLS](https://github.com/B-Analytics/diPLSlib/blob/main/notebooks/demo_diPLS.ipynb) 120 | - [Including multiple domains (mdi-PLS)](https://github.com/B-Analytics/diPLSlib/blob/main/notebooks/demo_mdiPLS.ipynb) 121 | - [Implicit calibration transfer with GCT-PLS](https://github.com/B-Analytics/diPLSlib/blob/main/notebooks/demo_gctPLS.ipynb) 122 | - [Model selection (with `scikit-learn`)](https://github.com/B-Analytics/diPLSlib/blob/main/notebooks/demo_ModelSelection.ipynb) 123 | - [Privacy-preserving regression with EDPLS](https://github.com/B-Analytics/diPLSlib/blob/main/notebooks/demo_edPLS.ipynb) 124 | - [Non-parametric domain adaptation with KDAPLS](https://github.com/B-Analytics/diPLSlib/blob/main/notebooks/demo_daPLS.ipynb) 125 | 126 | # Documentation 127 | The documentation can be found [here](https://di-pls.readthedocs.io/en/latest/diPLSlib.html). 128 | 129 | # Acknowledgements 130 | The first version of di-PLS was developed by Ramin Nikzad-Langerodi, Werner Zellinger, Edwin Lughofer, Bernhard Moser and Susanne Saminger-Platz 131 | and published in: 132 | 133 | - *Ramin Nikzad-Langerodi, Werner Zellinger, Edwin Lughofer, and Susanne Saminger-Platz 134 | Analytical Chemistry 2018 90 (11), 6693-6701 https://doi.org/10.1021/acs.analchem.8b00498* 135 | 136 | Further refinements to the initial algorithm were published in: 137 | 138 | - *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.* 139 | 140 | - *Ramin Nikzad-Langerodi, Werner Zellinger, Susanne Saminger-Platz, Bernhard A. Moser, 141 | Domain adaptation for regression under Beer–Lambert’s law, 142 | Knowledge-Based Systems, Volume 210, 2020, https://doi.org/10.1016/j.knosys.2020.106447.* 143 | 144 | - *Bianca Mikulasek, Valeria Fonseca Diaz, David Gabauer, Christoph Herwig, Ramin Nikzad-Langerodi, 145 | "Partial least squares regression with multiple domains" Journal of Chemometrics 2023 37 (5), e3477, https://doi.org/10.13140/RG.2.2.23750.75845* 146 | 147 | - *Ramin Nikzad-Langerodi & Florian Sobieczky (2021). Graph‐based calibration transfer. Journal of Chemometrics, 35(4), e3319. https://doi.org/10.1002/cem.3319* 148 | 149 | - *Ramin Nikzad-Langerodi, Mohit Kumar, Du Nguyen Duy, and Mahtab Alghasi (2024), "(epsilon, delta)-Differentially Private Partial Least Squares Regression", unpublished.* 150 | 151 | # Contact us 152 | Bottleneck Analytics GmbH 153 | info@bottleneck-analytics.com 154 | 155 | -------------------------------------------------------------------------------- /doc/_build/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |diPLSlib is a Python library designed for domain adaptation in multivariate calibration, with a focus on privacy-preserving regression and calibration model maintenance. It provides a scikit-learn compatible API and implements advanced methods for aligning data distributions across different domains, enabling robust and transferable regression models.
79 |The library features several state-of-the-art algorithms, including:
80 |Domain-Invariant Partial Least Squares (di-PLS/mdi-PLS): Aligns feature distributions between source and target domains to improve model generalization.
Graph-based Calibration Transfer (GCT-PLS): Minimizes discrepancies between paired samples from different domains in the latent variable space.
Kernel Domain Adaptive PLS (KDAPLS): Projects data into a reproducing kernel Hilbert space for non-parametric domain adaptation.
Differentially Private PLS (EDPLS): Ensures privacy guarantees for sensitive data using the \((\epsilon, \delta)\)-differential privacy framework.
diPLSlib is suitable for chemometrics, analytical chemistry, and other fields where robust calibration transfer and privacy-preserving modeling are required. For more details, usage examples, and API documentation, please refer to the sections below.
87 |Contents:
89 |convex_relaxation()dipals()edpls()kdapls()transfer_laplacian()DIPLSDIPLS.fit()DIPLS.predict()DIPLS.set_fit_request()DIPLS.set_score_request()EDPLSEDPLS.fit()EDPLS.predict()EDPLS.set_predict_request()EDPLS.set_score_request()GCTPLSGCTPLS.fit()GCTPLS.set_fit_request()GCTPLS.set_score_request()KDAPLSKDAPLS.fit()KDAPLS.predict()KDAPLS.set_fit_request()KDAPLS.set_score_request()| 94 | |
|
98 |
|
122 | 145 | |
|
153 |
|
157 |
|
173 |
|
181 |
|
185 |
|
193 |
|
201 |
|
205 |
|
226 |
|
240 |
|
248 |
|
264 |
|
276 |
|
284 |
Some helper functions for diPLSlib
92 |Calibrate a Gaussian perturbation for differential privacy using the analytic Gaussian mechanism of [Balle and Wang, ICML’18]
96 |Privacy parameter epsilon
100 |Desired privacy failure probability
102 |Upper bound on the L2-sensitivity of the function to which the mechanism is applied
104 |Error tolerance for binary search
106 |Standard deviation of Gaussian noise needed to achieve (epsilon,delta)-DP under global sensitivity GS
112 |References
117 |Balle, B., & Wang, Y. X. (2018, July). Improving the gaussian mechanism for differential privacy: Analytical calibration and optimal denoising. In International Conference on Machine Learning (pp. 394-403). PMLR.
Examples
121 |>>> from diPLSlib.utils.misc import calibrateAnalyticGaussianMechanism
122 | >>> calibrateAnalyticGaussianMechanism(1.0, 1e-5, 1.0)
123 | 3.730631634944469
124 | Generate a Gaussian spectrum-like signal with optional random noise.
132 |Length of the generated signal.
136 |Mean of the Gaussian function.
138 |Standard deviation of the Gaussian function.
140 |Magnitude of the Gaussian signal.
142 |Standard deviation of the Gaussian noise to be added to the signal.
144 |The generated Gaussian signal with noise.
150 |Examples
155 |>>> from diPLSlib.utils.misc import gengaus
156 | >>> import numpy as np
157 | >>> import scipy.stats
158 | >>> signal = gengaus(100, 50, 10, 5, noise=0.1)
159 | Compute the 95% confidence interval ellipse for a 2D scatter plot.
167 |Matrix of data points.
171 |Significance level for the confidence interval.
173 |Coordinates of the ellipse’s points. To plot, use plt.plot(el[0, :], el[1, :]).
179 |Examples
184 |>>> import matplotlib.pyplot as plt
185 | >>> import numpy as np
186 | >>> from diPLSlib.utils.misc import hellipse
187 | >>> X = np.random.random((100, 2))
188 | >>> el = hellipse(X)
189 | >>> plt.scatter(X[:,0], X[:,1], label='Data points')
190 | <matplotlib.collections.PathCollection object at ...>
191 | >>> plt.plot(el[0,:], el[1,:], label='95% Confidence Ellipse')
192 | [<matplotlib.lines.Line2D object at ...>]
193 | >>> plt.legend()
194 | <matplotlib.legend.Legend object at ...>
195 | Compute the Root Mean Squared Error (RMSE) between two arrays.
203 |True values.
207 |Predicted values.
209 |The RMSE between y and yhat.
215 |Examples
220 |>>> import numpy as np
221 | >>> from diPLSlib.utils.misc import rmse
222 | >>> x = np.array([1, 2, 3])
223 | >>> y = np.array([2, 3, 4])
224 | >>> error = rmse(x, y)
225 | >>> print(error)
226 | 1.0
227 |