ddsimca 1.0.2__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ddsimca-1.1.0/.gitignore +8 -0
- ddsimca-1.1.0/PKG-INFO +99 -0
- ddsimca-1.1.0/README.md +65 -0
- ddsimca-1.1.0/ddsimca/__init__.py +37 -0
- ddsimca-1.1.0/ddsimca/_base.py +1647 -0
- ddsimca-1.1.0/ddsimca/ddsimca.py +310 -0
- ddsimca-1.1.0/ddsimca/ddsimca_parafac.py +295 -0
- ddsimca-1.1.0/ddsimca/ddsimca_tucker.py +322 -0
- ddsimca-1.1.0/demo/demo.ipynb +1379 -0
- {ddsimca-1.0.2 → ddsimca-1.1.0}/demo/demo.md +15 -8
- ddsimca-1.1.0/demo/demo.pdf +0 -0
- ddsimca-1.1.0/demo/demo_3way.ipynb +1640 -0
- ddsimca-1.1.0/demo/demo_3way.pdf +0 -0
- ddsimca-1.1.0/demo/simdata.mat +0 -0
- {ddsimca-1.0.2 → ddsimca-1.1.0}/pyproject.toml +7 -5
- ddsimca-1.1.0/tests/__init__.py +0 -0
- ddsimca-1.1.0/tests/golden/.gitkeep +0 -0
- ddsimca-1.1.0/tests/golden/README.md +7 -0
- ddsimca-1.1.0/tests/golden/legacy_model.pkl +0 -0
- ddsimca-1.1.0/tests/golden/legacy_result.pkl +0 -0
- ddsimca-1.1.0/tests/golden/m_scaled_center_values.npy +0 -0
- ddsimca-1.1.0/tests/golden/m_scaled_hParams_c0.npy +0 -0
- ddsimca-1.1.0/tests/golden/m_scaled_hParams_c1.npy +0 -0
- ddsimca-1.1.0/tests/golden/m_scaled_hParams_r0.npy +0 -0
- ddsimca-1.1.0/tests/golden/m_scaled_qParams_c0.npy +0 -0
- ddsimca-1.1.0/tests/golden/m_scaled_qParams_c1.npy +0 -0
- ddsimca-1.1.0/tests/golden/m_scaled_qParams_r0.npy +0 -0
- ddsimca-1.1.0/tests/golden/m_scaled_scale_values.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_classic_D.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_classic_F.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_classic_H.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_classic_Q.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_classic_R.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_classic_T.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_classic_U.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_classic_outcomes.csv +4 -0
- ddsimca-1.1.0/tests/golden/parafac_robust_D.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_robust_F.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_robust_H.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_robust_Q.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_robust_R.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_robust_T.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_robust_U.npy +0 -0
- ddsimca-1.1.0/tests/golden/parafac_robust_outcomes.csv +4 -0
- ddsimca-1.1.0/tests/golden/parafac_versions.json +5 -0
- ddsimca-1.1.0/tests/golden/r_classic_D.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_classic_E.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_classic_F.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_classic_H.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_classic_Q.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_classic_R.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_classic_T.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_classic_U.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_classic_outcomes.csv +11 -0
- ddsimca-1.1.0/tests/golden/r_robust_D.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_robust_E.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_robust_F.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_robust_H.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_robust_Q.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_robust_R.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_robust_T.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_robust_U.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_robust_outcomes.csv +11 -0
- ddsimca-1.1.0/tests/golden/r_scaled_H.npy +0 -0
- ddsimca-1.1.0/tests/golden/r_scaled_Q.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_classic_D.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_classic_F.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_classic_H.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_classic_Q.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_classic_R.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_classic_T.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_classic_U.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_classic_outcomes.csv +4 -0
- ddsimca-1.1.0/tests/golden/tucker_robust_D.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_robust_F.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_robust_H.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_robust_Q.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_robust_R.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_robust_T.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_robust_U.npy +0 -0
- ddsimca-1.1.0/tests/golden/tucker_robust_outcomes.csv +4 -0
- ddsimca-1.1.0/tests/golden/tucker_versions.json +5 -0
- ddsimca-1.1.0/tests/golden_notebook.ipynb +481 -0
- ddsimca-1.1.0/tests/golden_parafac_setup.py +79 -0
- ddsimca-1.1.0/tests/golden_tucker_setup.py +72 -0
- ddsimca-1.1.0/tests/test_ddsimca.py +645 -0
- ddsimca-1.1.0/tests/test_ddsimca_abstraction.py +157 -0
- ddsimca-1.1.0/tests/test_ddsimca_parafac.py +722 -0
- ddsimca-1.1.0/tests/test_ddsimca_tucker.py +681 -0
- ddsimca-1.0.2/.gitignore +0 -4
- ddsimca-1.0.2/PKG-INFO +0 -69
- ddsimca-1.0.2/README.md +0 -36
- ddsimca-1.0.2/ddsimca/__init__.py +0 -11
- ddsimca-1.0.2/ddsimca/ddsimca.py +0 -1309
- ddsimca-1.0.2/demo/demo.ipynb +0 -963
- ddsimca-1.0.2/tests/test_ddsimca.py +0 -180
- {ddsimca-1.0.2 → ddsimca-1.1.0}/LICENSE +0 -0
- {ddsimca-1.0.2 → ddsimca-1.1.0}/demo/All_Test.csv +0 -0
- {ddsimca-1.0.2 → ddsimca-1.1.0}/demo/New_Susp.csv +0 -0
- {ddsimca-1.0.2 → ddsimca-1.1.0}/demo/NonTarget_Non_Or.csv +0 -0
- {ddsimca-1.0.2 → ddsimca-1.1.0}/demo/Oregano.zip +0 -0
- {ddsimca-1.0.2 → ddsimca-1.1.0}/demo/Target_Greece.csv +0 -0
- {ddsimca-1.0.2 → ddsimca-1.1.0}/demo/Target_Test.csv +0 -0
- {ddsimca-1.0.2 → ddsimca-1.1.0}/demo/Target_Train.csv +0 -0
ddsimca-1.1.0/.gitignore
ADDED
ddsimca-1.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ddsimca
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Implementation of Data Driven SIMCA one class classification method
|
|
5
|
+
Project-URL: Homepage, https://github.com/svkucheryavski/ddsimca
|
|
6
|
+
Project-URL: Documentation, https://github.com/svkucheryavski/ddsimca
|
|
7
|
+
Project-URL: Repository, https://github.com/svkucheryavski/ddsimca
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/svkucheryavski/ddsimca/issues
|
|
9
|
+
Author-email: Sergey Kucheryavskiy <svkucheryavski@gmail.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: anomaly-detection,chemometrics,ddsimca,one-class-classification,simca
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: matplotlib>=3.8.0
|
|
24
|
+
Requires-Dist: numpy>=2.0
|
|
25
|
+
Requires-Dist: pandas>=2.2.0
|
|
26
|
+
Requires-Dist: prcv>1.2.0
|
|
27
|
+
Requires-Dist: scipy>=1.6.0
|
|
28
|
+
Provides-Extra: 3way
|
|
29
|
+
Requires-Dist: tensorly<0.10,>=0.9; extra == '3way'
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: nbval>=0.11.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# Data Driven SIMCA
|
|
36
|
+
|
|
37
|
+
The package *ddsimca* implements *Data Driven SIMCA* — a method for creating one-class classification (OCC) models (also known as *anomaly detectors* or *novelty detectors*). The theoretical background and practical examples for the conventional (PCA/SVD-based) DD-SIMCA method are described in [this paper](https://doi.org/10.1002/cem.3556); please cite it when using this package. The paper is freely available via open access. Other papers describing different theoretical aspects of the method are listed in the *References* section below.
|
|
38
|
+
|
|
39
|
+
The paper shows all examples using the DD-SIMCA web application ([mda.tools/ddsimca](https://mda.tools/ddsimca)). This package implements the same functionality in Python, so you can obtain the same outcomes and similar plots. The package can be installed from [PyPI](https://pypi.org) using `pip` or any other package manager compatible with PyPI, e.g.:
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
pip install ddsimca
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
It requires `numpy`, `scipy`, `pandas`, `prcv`, and `matplotlib`, which will be installed automatically as dependencies.
|
|
47
|
+
|
|
48
|
+
Since v. 1.1.0 the package also provides two methods for **3-way (multi-mode) data** — `ddsimca_parafac` and `ddsimca_tucker`. Their theoretical background is described in [this paper](https://doi.org/10.1021/acs.analchem.3c05096).
|
|
49
|
+
|
|
50
|
+
These two methods rely on an additional library, `tensorly`, which is **not** installed by the standard `pip install ddsimca` command shown above. If you plan to use the 3-way methods, run this instead:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
pip install ddsimca[3way]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
This installs everything from the standard `ddsimca` plus `tensorly` in one step. If you already have `ddsimca` installed and only want to add 3-way support, run `pip install tensorly` separately.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
## Getting started
|
|
60
|
+
|
|
61
|
+
Use the Jupyter notebook [demo.ipynb](https://github.com/svkucheryavski/ddsimca-py/blob/main/demo/demo.ipynb) to get started with the conventional PCA-based DD-SIMCA. To run the examples in this notebook you need to download a zip file with the datasets (the same dataset is used to illustrate the method in the paper). Here is a [direct link](https://mda.tools/ddsimca/Oregano.zip) to the archive.
|
|
62
|
+
|
|
63
|
+
Simply download the dataset, unzip it to the same directory as the notebook, and follow the guidelines. The dataset can also be downloaded from GitHub.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
For 3-way DD-SIMCA, use the Jupyter notebook [demo_3way.ipynb](https://github.com/svkucheryavski/ddsimca-py/blob/main/demo/demo_3way.ipynb). It assumes you already know how conventional DD-SIMCA works. The dataset for this notebook can be downloaded from [here](https://github.com/svkucheryavski/ddsimca-py/blob/main/demo/simdata.mat). It is a MATLAB data file (.mat) with simulated data, kindly prepared and shared by Alejandro Olivieri. The notebook explains how to load the data.
|
|
67
|
+
|
|
68
|
+
Both notebooks are also available as PDF files with all plots and outputs: [demo.pdf](https://github.com/svkucheryavski/ddsimca-py/blob/main/demo/demo.pdf) and [demo_3way.pdf](https://github.com/svkucheryavski/ddsimca-py/blob/main/demo/demo_3way.pdf)
|
|
69
|
+
|
|
70
|
+
## Releases
|
|
71
|
+
|
|
72
|
+
**1.1.0** (12/6/2026)
|
|
73
|
+
* added support for custom colors and markers in `plotAcceptance()` and `plotDistance()`.
|
|
74
|
+
* added support for showing log-transformed values in `plotDistance()`.
|
|
75
|
+
* added `ddsimca_parafac` variant for 3-way (multi-mode) data based on PARAFAC decomposition.
|
|
76
|
+
* added `ddsimca_tucker` variant for 3-way (multi-mode) data based on Tucker decomposition.
|
|
77
|
+
* added `demo_3way.ipynb` Jupyter notebook with a user guide for the 3-way methods.
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
**1.0.3** (6/1/2026)
|
|
81
|
+
* small improvements to code.
|
|
82
|
+
* better documentation text.
|
|
83
|
+
|
|
84
|
+
**1.0.2** (1/1/2026)
|
|
85
|
+
* initial release
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## References
|
|
90
|
+
|
|
91
|
+
1. S. Kucheryavskiy, O. Rodionova, A. Pomerantsev. *A comprehensive tutorial on Data-Driven SIMCA: Theory and implementation in web*. Journal of Chemometrics, 38 (7), 2024. DOI: [10.1002/cem.3556](http://dx.doi.org/10.1002/cem.3556).
|
|
92
|
+
|
|
93
|
+
2. A. Pomerantsev, O. Rodionova. *Selectivity in Nontargeted Qualitative Analysis*. Analytica Chimica Acta, 1332, 2024. DOI: [10.1016/j.aca.2024.343352](https://doi.org/10.1016/j.aca.2024.343352).
|
|
94
|
+
|
|
95
|
+
3. A. Pomerantsev, O. Rodionova. *Popular decision rules in SIMCA: Critical review*. Journal of Chemometrics, 34 (8), 2020. DOI: [10.1002/cem.3250](https://doi.org/10.1002/cem.3250)
|
|
96
|
+
|
|
97
|
+
4. A. Pomerantsev, O. Rodionova. *On the type II error in SIMCA method*. Journal of Chemometrics, 28 (6), 2014. DOI: [10.1002/cem.2610](https://doi.org/10.1002/cem.2610).
|
|
98
|
+
|
|
99
|
+
5. A. P. Pagani, G. Camargo, G. A. Ibañez, A. C. Olivieri, A. L. Pomerantsev, O. Ye. Rodionova. *Data-Driven Version of Multiway Soft Independent Modeling of Class Analogy (N-Way DD-SIMCA): Theory and Application*. Analytical Chemistry, 96 (12), 2024. DOI: [10.1021/acs.analchem.3c05096](https://doi.org/10.1021/acs.analchem.3c05096).
|
ddsimca-1.1.0/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Data Driven SIMCA
|
|
2
|
+
|
|
3
|
+
The package *ddsimca* implements *Data Driven SIMCA* — a method for creating one-class classification (OCC) models (also known as *anomaly detectors* or *novelty detectors*). The theoretical background and practical examples for the conventional (PCA/SVD-based) DD-SIMCA method are described in [this paper](https://doi.org/10.1002/cem.3556); please cite it when using this package. The paper is freely available via open access. Other papers describing different theoretical aspects of the method are listed in the *References* section below.
|
|
4
|
+
|
|
5
|
+
The paper shows all examples using the DD-SIMCA web application ([mda.tools/ddsimca](https://mda.tools/ddsimca)). This package implements the same functionality in Python, so you can obtain the same outcomes and similar plots. The package can be installed from [PyPI](https://pypi.org) using `pip` or any other package manager compatible with PyPI, e.g.:
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
pip install ddsimca
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
It requires `numpy`, `scipy`, `pandas`, `prcv`, and `matplotlib`, which will be installed automatically as dependencies.
|
|
13
|
+
|
|
14
|
+
Since v. 1.1.0 the package also provides two methods for **3-way (multi-mode) data** — `ddsimca_parafac` and `ddsimca_tucker`. Their theoretical background is described in [this paper](https://doi.org/10.1021/acs.analchem.3c05096).
|
|
15
|
+
|
|
16
|
+
These two methods rely on an additional library, `tensorly`, which is **not** installed by the standard `pip install ddsimca` command shown above. If you plan to use the 3-way methods, run this instead:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
pip install ddsimca[3way]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This installs everything from the standard `ddsimca` plus `tensorly` in one step. If you already have `ddsimca` installed and only want to add 3-way support, run `pip install tensorly` separately.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Getting started
|
|
26
|
+
|
|
27
|
+
Use the Jupyter notebook [demo.ipynb](https://github.com/svkucheryavski/ddsimca-py/blob/main/demo/demo.ipynb) to get started with the conventional PCA-based DD-SIMCA. To run the examples in this notebook you need to download a zip file with the datasets (the same dataset is used to illustrate the method in the paper). Here is a [direct link](https://mda.tools/ddsimca/Oregano.zip) to the archive.
|
|
28
|
+
|
|
29
|
+
Simply download the dataset, unzip it to the same directory as the notebook, and follow the guidelines. The dataset can also be downloaded from GitHub.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
For 3-way DD-SIMCA, use the Jupyter notebook [demo_3way.ipynb](https://github.com/svkucheryavski/ddsimca-py/blob/main/demo/demo_3way.ipynb). It assumes you already know how conventional DD-SIMCA works. The dataset for this notebook can be downloaded from [here](https://github.com/svkucheryavski/ddsimca-py/blob/main/demo/simdata.mat). It is a MATLAB data file (.mat) with simulated data, kindly prepared and shared by Alejandro Olivieri. The notebook explains how to load the data.
|
|
33
|
+
|
|
34
|
+
Both notebooks are also available as PDF files with all plots and outputs: [demo.pdf](https://github.com/svkucheryavski/ddsimca-py/blob/main/demo/demo.pdf) and [demo_3way.pdf](https://github.com/svkucheryavski/ddsimca-py/blob/main/demo/demo_3way.pdf)
|
|
35
|
+
|
|
36
|
+
## Releases
|
|
37
|
+
|
|
38
|
+
**1.1.0** (12/6/2026)
|
|
39
|
+
* added support for custom colors and markers in `plotAcceptance()` and `plotDistance()`.
|
|
40
|
+
* added support for showing log-transformed values in `plotDistance()`.
|
|
41
|
+
* added `ddsimca_parafac` variant for 3-way (multi-mode) data based on PARAFAC decomposition.
|
|
42
|
+
* added `ddsimca_tucker` variant for 3-way (multi-mode) data based on Tucker decomposition.
|
|
43
|
+
* added `demo_3way.ipynb` Jupyter notebook with a user guide for the 3-way methods.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
**1.0.3** (6/1/2026)
|
|
47
|
+
* small improvements to code.
|
|
48
|
+
* better documentation text.
|
|
49
|
+
|
|
50
|
+
**1.0.2** (1/1/2026)
|
|
51
|
+
* initial release
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## References
|
|
56
|
+
|
|
57
|
+
1. S. Kucheryavskiy, O. Rodionova, A. Pomerantsev. *A comprehensive tutorial on Data-Driven SIMCA: Theory and implementation in web*. Journal of Chemometrics, 38 (7), 2024. DOI: [10.1002/cem.3556](http://dx.doi.org/10.1002/cem.3556).
|
|
58
|
+
|
|
59
|
+
2. A. Pomerantsev, O. Rodionova. *Selectivity in Nontargeted Qualitative Analysis*. Analytica Chimica Acta, 1332, 2024. DOI: [10.1016/j.aca.2024.343352](https://doi.org/10.1016/j.aca.2024.343352).
|
|
60
|
+
|
|
61
|
+
3. A. Pomerantsev, O. Rodionova. *Popular decision rules in SIMCA: Critical review*. Journal of Chemometrics, 34 (8), 2020. DOI: [10.1002/cem.3250](https://doi.org/10.1002/cem.3250)
|
|
62
|
+
|
|
63
|
+
4. A. Pomerantsev, O. Rodionova. *On the type II error in SIMCA method*. Journal of Chemometrics, 28 (6), 2014. DOI: [10.1002/cem.2610](https://doi.org/10.1002/cem.2610).
|
|
64
|
+
|
|
65
|
+
5. A. P. Pagani, G. Camargo, G. A. Ibañez, A. C. Olivieri, A. L. Pomerantsev, O. Ye. Rodionova. *Data-Driven Version of Multiway Soft Independent Modeling of Class Analogy (N-Way DD-SIMCA): Theory and Application*. Analytical Chemistry, 96 (12), 2024. DOI: [10.1021/acs.analchem.3c05096](https://doi.org/10.1021/acs.analchem.3c05096).
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""
|
|
2
|
+
DD-SIMCA: one-class classification method
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
__version__ = "1.1.0"
|
|
6
|
+
__author__ = "Sergey Kucheryavskiy"
|
|
7
|
+
__email__ = "svkucheryavski@gmail.com"
|
|
8
|
+
|
|
9
|
+
from .ddsimca import (
|
|
10
|
+
DDSIMCA, DDSIMCARes, ddsimca,
|
|
11
|
+
get_distparams, get_limits, process_members, process_strangers,
|
|
12
|
+
COLORS_FOMS, COLORS_ROLES, COLORS_DECISIONS,
|
|
13
|
+
MARKERS_ROLES, MARKERS_DECISIONS,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"DDSIMCA", "DDSIMCARes", "ddsimca",
|
|
18
|
+
"get_distparams", "get_limits", "process_members", "process_strangers",
|
|
19
|
+
"COLORS_FOMS", "COLORS_ROLES", "COLORS_DECISIONS",
|
|
20
|
+
"MARKERS_ROLES", "MARKERS_DECISIONS",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
# PARAFAC and Tucker variants — both require tensorly (install with:
|
|
24
|
+
# pip install ddsimca[3way]). The tensorly imports are lazy inside each
|
|
25
|
+
# variant's train(), so this module imports cleanly without tensorly.
|
|
26
|
+
# The guard below is narrow defense-in-depth for the case where someone
|
|
27
|
+
# reintroduces an import-time tensorly dependency in one of the variant
|
|
28
|
+
# modules; arbitrary ImportError still propagates so real bugs are not
|
|
29
|
+
# masked.
|
|
30
|
+
try:
|
|
31
|
+
from ddsimca.ddsimca_parafac import DDSIMCAParafac, ddsimca_parafac
|
|
32
|
+
from ddsimca.ddsimca_tucker import DDSIMCATucker, ddsimca_tucker
|
|
33
|
+
__all__ = list(__all__) + ["DDSIMCAParafac", "ddsimca_parafac",
|
|
34
|
+
"DDSIMCATucker", "ddsimca_tucker"]
|
|
35
|
+
except ModuleNotFoundError as _err:
|
|
36
|
+
if _err.name != "tensorly":
|
|
37
|
+
raise
|