clustvartools 0.0.1__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.
- clustvartools-0.0.1/LICENSE +21 -0
- clustvartools-0.0.1/PKG-INFO +223 -0
- clustvartools-0.0.1/README.md +178 -0
- clustvartools-0.0.1/clustvartools/__init__.py +6 -0
- clustvartools-0.0.1/clustvartools/clustering/__init__.py +24 -0
- clustvartools-0.0.1/clustvartools/clustering/_catclv.py +630 -0
- clustvartools-0.0.1/clustvartools/clustering/_cathcav.py +400 -0
- clustvartools-0.0.1/clustvartools/clustering/_catvarhca.py +416 -0
- clustvartools-0.0.1/clustvartools/clustering/_clv.py +631 -0
- clustvartools-0.0.1/clustvartools/clustering/_clvmix.py +707 -0
- clustvartools-0.0.1/clustvartools/clustering/_corclv.py +552 -0
- clustvartools-0.0.1/clustvartools/clustering/_dclv.py +580 -0
- clustvartools-0.0.1/clustvartools/clustering/_hcav.py +384 -0
- clustvartools-0.0.1/clustvartools/clustering/_hcavmix.py +401 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/__init__.py +0 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/cathca.py +64 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/concat_empty.py +25 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/cov2corr.py +29 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/func_dclv.py +134 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/func_fillna.py +40 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/get_indices.py +43 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/get_sup_label.py +61 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/gsvd.py +107 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/preprocessing.py +69 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/revalue.py +63 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/statistics.py +354 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/tests.py +259 -0
- clustvartools-0.0.1/clustvartools/clustering/functions/utils.py +175 -0
- clustvartools-0.0.1/clustvartools/datasets/__init__.py +447 -0
- clustvartools-0.0.1/clustvartools/datasets/data/__init__.py +0 -0
- clustvartools-0.0.1/clustvartools/datasets/data/apples.xlsx +0 -0
- clustvartools-0.0.1/clustvartools/datasets/data/autos2005.xlsx +0 -0
- clustvartools-0.0.1/clustvartools/datasets/data/burger.xlsx +0 -0
- clustvartools-0.0.1/clustvartools/datasets/data/canines.xlsx +0 -0
- clustvartools-0.0.1/clustvartools/datasets/data/cars.xlsx +0 -0
- clustvartools-0.0.1/clustvartools/datasets/data/congressvotingrecords.xlsx +0 -0
- clustvartools-0.0.1/clustvartools/datasets/data/decathlon.xlsx +0 -0
- clustvartools-0.0.1/clustvartools/datasets/data/jobrate.xlsx +0 -0
- clustvartools-0.0.1/clustvartools/datasets/data/olympic.xlsx +0 -0
- clustvartools-0.0.1/clustvartools/datasets/data/poison.xlsx +0 -0
- clustvartools-0.0.1/clustvartools/datasets/data/uscrime.xlsx +0 -0
- clustvartools-0.0.1/clustvartools/datasets/data/wine.xlsx +0 -0
- clustvartools-0.0.1/clustvartools/graphics/__init__.py +12 -0
- clustvartools-0.0.1/clustvartools/graphics/_fviz_dend.py +562 -0
- clustvartools-0.0.1/clustvartools/graphics/_fviz_dend2.py +600 -0
- clustvartools-0.0.1/clustvartools/graphics/_fviz_height.py +167 -0
- clustvartools-0.0.1/clustvartools/others/__init__.py +29 -0
- clustvartools-0.0.1/clustvartools/others/_clust_diss.py +82 -0
- clustvartools-0.0.1/clustvartools/others/_clust_dist.py +72 -0
- clustvartools-0.0.1/clustvartools/others/_clust_member.py +68 -0
- clustvartools-0.0.1/clustvartools/others/_clust_score.py +55 -0
- clustvartools-0.0.1/clustvartools/others/_coeffsim.py +108 -0
- clustvartools-0.0.1/clustvartools/others/_disjunctive.py +70 -0
- clustvartools-0.0.1/clustvartools/others/_getnnsvar.py +50 -0
- clustvartools-0.0.1/clustvartools/others/_save.py +82 -0
- clustvartools-0.0.1/clustvartools/others/_splitmix.py +69 -0
- clustvartools-0.0.1/clustvartools/others/_sprintf.py +63 -0
- clustvartools-0.0.1/clustvartools/others/_summary.py +189 -0
- clustvartools-0.0.1/clustvartools.egg-info/PKG-INFO +223 -0
- clustvartools-0.0.1/clustvartools.egg-info/SOURCES.txt +63 -0
- clustvartools-0.0.1/clustvartools.egg-info/dependency_links.txt +1 -0
- clustvartools-0.0.1/clustvartools.egg-info/requires.txt +10 -0
- clustvartools-0.0.1/clustvartools.egg-info/top_level.txt +1 -0
- clustvartools-0.0.1/setup.cfg +4 -0
- clustvartools-0.0.1/setup.py +46 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 enfantbenidedieu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: clustvartools
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Python library for clustering of variables
|
|
5
|
+
Home-page: https://github.com/enfantbenidedieu/clustvartools
|
|
6
|
+
Author: Duverier DJIFACK ZEBAZE
|
|
7
|
+
Author-email: djifacklab@gmail.com
|
|
8
|
+
Project-URL: Bug Reports, https://github.com/enfantbenidedieu/clustvartools/issues
|
|
9
|
+
Project-URL: Source, https://github.com/enfantbenidedieu/clustvartools
|
|
10
|
+
Project-URL: Documentation, https://clustvartools.readthedocs.io
|
|
11
|
+
Keywords: cluster analysis,multidimensional analysis,hierarchical clustering,partition
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Topic :: Software Development
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: numpy>=1.21
|
|
24
|
+
Requires-Dist: pandas>=1.4
|
|
25
|
+
Requires-Dist: scikit-learn>=1.2
|
|
26
|
+
Requires-Dist: statsmodels>=0.14.6
|
|
27
|
+
Requires-Dist: plotnine>=0.10.1
|
|
28
|
+
Requires-Dist: openpyxl>=3.1.5
|
|
29
|
+
Requires-Dist: adjustText>=0.8.2
|
|
30
|
+
Requires-Dist: pyreadr>=0.5.4
|
|
31
|
+
Requires-Dist: mizani>=0.14.4
|
|
32
|
+
Requires-Dist: tabulate>=0.9.0
|
|
33
|
+
Dynamic: author
|
|
34
|
+
Dynamic: author-email
|
|
35
|
+
Dynamic: classifier
|
|
36
|
+
Dynamic: description
|
|
37
|
+
Dynamic: description-content-type
|
|
38
|
+
Dynamic: home-page
|
|
39
|
+
Dynamic: keywords
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
Dynamic: project-url
|
|
42
|
+
Dynamic: requires-dist
|
|
43
|
+
Dynamic: requires-python
|
|
44
|
+
Dynamic: summary
|
|
45
|
+
|
|
46
|
+
<p align="center">
|
|
47
|
+
<img src="./docs/source/_static/clustvartools.svg" height=300></img>
|
|
48
|
+
</p>
|
|
49
|
+
|
|
50
|
+
<div align="center">
|
|
51
|
+
|
|
52
|
+
[](https://github.com/enfantbenidedieu/clustvartools/blob/master/LICENSE)
|
|
53
|
+
[](https://pypi.org/project/clustvartools/)
|
|
54
|
+
[](https://pepy.tech/project/clustvartools)
|
|
55
|
+
[](https://pepy.tech/project/clustvartools)
|
|
56
|
+
[](https://pepy.tech/project/clustvartools)
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
# clustvartools : Clustering of Variables with Python
|
|
61
|
+
|
|
62
|
+
# Contents
|
|
63
|
+
|
|
64
|
+
**1. [Overview](#overview)**
|
|
65
|
+
|
|
66
|
+
**2. [Installation](#installation)**
|
|
67
|
+
|
|
68
|
+
* [2.1 Global environmen](#genv)
|
|
69
|
+
* [2.2 Virtual environment](#venv)
|
|
70
|
+
* [2.3 Version](#version)
|
|
71
|
+
* [2.4 Dependencies](#dependencies)
|
|
72
|
+
|
|
73
|
+
**3. [Example](#example)**
|
|
74
|
+
|
|
75
|
+
**4. [Documentation](#doc)**
|
|
76
|
+
|
|
77
|
+
**5. [About us](#about_us)**
|
|
78
|
+
|
|
79
|
+
* [5.1 Authors](#authors)
|
|
80
|
+
* [5.2 Feedbacks](#authors)
|
|
81
|
+
* [5.3 Citing clustvartools](#citing)
|
|
82
|
+
|
|
83
|
+
## Overview <a name="overview"></a>
|
|
84
|
+
|
|
85
|
+
clustvartools is a python library for clustering of variables. It provides functions for :
|
|
86
|
+
|
|
87
|
+
1. **Cluster Analysis**
|
|
88
|
+
|
|
89
|
+
1. *CatCLV* - Hierarchical Clustering of Categorical Variables around Latent Variables
|
|
90
|
+
2. *CatHCAV* - Hierarchical Clustering Analysis of Categorical Variables
|
|
91
|
+
3. *CatVARHCA* - Categorical Variables Hierarchical Clustering Analysis
|
|
92
|
+
4. *CLV* - Hierarchical Clustering of Variables around Latent Variables
|
|
93
|
+
5. *CLVmix* - Hierarchical Clustering of Mixed Variables around Latent Variables
|
|
94
|
+
6. *CorCLV* - Hierarchical Clustering of Variables from a covariance/correlation matrix
|
|
95
|
+
7. *DCLV* - Divisive Clustering of Variables around Latent Variables
|
|
96
|
+
8. *HCAV* - Hierarchical Clustering Analysis for Variables
|
|
97
|
+
9. *HCAVmix* - Hierarchical Clustering Analysis of Variables for Mixed Data
|
|
98
|
+
|
|
99
|
+
4. In some methods, it allowed to add supplementary variables.
|
|
100
|
+
5. It provides a geometrical point of view.
|
|
101
|
+
6. It provides efficient implementations, using a scikit-learn API.
|
|
102
|
+
|
|
103
|
+
## Installation <a name="installation"></a>
|
|
104
|
+
|
|
105
|
+
### Global environment <a name="genv"></a>
|
|
106
|
+
|
|
107
|
+
You can directly install clustvartools using pip :
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pip install clustvartools
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
or set a virtual environment.
|
|
114
|
+
|
|
115
|
+
### Virtual environment <a name="venv"></a>
|
|
116
|
+
|
|
117
|
+
Install the 64-bit version of Python 3, for instance from the [official website](https://www.python.org/). Now create a [virtual environment (venv)](https://docs.python.org/3/tutorial/venv.html) and install clustvartools.
|
|
118
|
+
|
|
119
|
+
The virtual environment is optional but strongly recommended, in order to avoid potential conflicts with other packages.
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
PS C:\> python -m venv clustvartools-env # create virtual env
|
|
123
|
+
PS C:\> clustvartools-env\Scripts\activate # activate
|
|
124
|
+
PS C:\> pip install -U clustvartools # install clustvartools
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Version <a name="version"></a>
|
|
128
|
+
|
|
129
|
+
In order to check your installation, you can use.
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
>>> import clustvartools
|
|
133
|
+
>>> print(clustvartools.__version__)
|
|
134
|
+
0.0.1
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Using an isolated environment such as *pip venv* or *conda* makes it possible to install a specific version of clustvartools with pip and conda and its dependencies independently of any previously installed Python packages.
|
|
138
|
+
|
|
139
|
+
You should always remember to activate the environment of your choice prior to running any Python command whenever you start a new terminal session.
|
|
140
|
+
|
|
141
|
+
### Dependencies <a name="dependencies"></a>
|
|
142
|
+
|
|
143
|
+
clustvartools is compatible with python version which supports both dependencies :
|
|
144
|
+
|
|
145
|
+
| Packages | Version |
|
|
146
|
+
| :---------------- | :------: |
|
|
147
|
+
| numpy | 1.21 |
|
|
148
|
+
| pandas | 1.4 |
|
|
149
|
+
| scikit-learn | 1.2 |
|
|
150
|
+
| statsmodels | 0.14.6 |
|
|
151
|
+
| plotnine | 0.10.1 |
|
|
152
|
+
| openpyxl | 3.1.5 |
|
|
153
|
+
| adjustText | 0.8.2 |
|
|
154
|
+
| pyreadr | 0.5.4 |
|
|
155
|
+
| mizani | 0.14.4 |
|
|
156
|
+
| tabulate | 0.9.0 |
|
|
157
|
+
|
|
158
|
+
## Example <a name="example"></a>
|
|
159
|
+
|
|
160
|
+
1. **Loading data**
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
>>> from clustvartools.datasets import decathlon
|
|
164
|
+
>>> data = decathlon.data
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
2. **Clustering of variables around Latent Variables (CLV)**
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
>>> from clustvartools import CLV
|
|
171
|
+
>>> clf = CLV(ncl=3,sup_var=(10,11,12))
|
|
172
|
+
>>> clf.fit(data)
|
|
173
|
+
CLV(ncl=3,sup_var=(10,11,12))
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
3. **Visualize dendrogram**
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
>>> from clustvartools import fviz_dend
|
|
180
|
+
>>> p = fviz_dend(obj=clf,color_labels_by_cluster=True,rect = True,rect_fill = True,color_labels_by_cluster=True,text_size=12,text_height=True,nudge_y=-0.03)
|
|
181
|
+
>>> print(p.show())
|
|
182
|
+
```
|
|
183
|
+
<center>
|
|
184
|
+
<img src="./docs/source/_static/fviz_dend_fill.png" alt="centered image"/>
|
|
185
|
+
</center>
|
|
186
|
+
|
|
187
|
+
4. **Extract results**
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
>>> # extract the results for variables
|
|
191
|
+
>>> quanti_var = clf.quanti_var_
|
|
192
|
+
>>> quanti_var._fields
|
|
193
|
+
... ('cluster','cor','cortest','sqload','member','sim','loadings')
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Documentation <a name="doc"></a>
|
|
197
|
+
|
|
198
|
+
The official documentation is hosted on [https://clustvartools.readthedocs.io](https://clustvartools.readthedocs.io).
|
|
199
|
+
|
|
200
|
+
## About Us <a name="about_us"></a>
|
|
201
|
+
|
|
202
|
+
### Authors <a name="authors"></a>
|
|
203
|
+
|
|
204
|
+
clustvartools is developed and maintained by [Duvérier DJIFACK ZEBAZE](https://www.linkedin.com/in/duv%C3%A9rier-djifack-z-030097118/), the founder of djifacklab (*Djifack Laboratory of Mathematics, Statistics and Economics books and packages production using Python Programming Language*).
|
|
205
|
+
|
|
206
|
+
The djifacklab laboratory maintains others python librairies such as [scientisttools](https://pypi.org/project/scientisttools/), [discrimintools](https://pypi.org/project/discrimintools/), [scientistmetrics](https://pypi.org/project/scientistmetrics/), [scientistshiny](https://pypi.org/project/scientistshiny/), [scientisttseries](https://pypi.org/project/scientistshiny/) and [ggcorrplot]( https://pypi.org/project/ggcorrplot/).
|
|
207
|
+
|
|
208
|
+
### Feedbacks <a name="feedbacks"></a>
|
|
209
|
+
|
|
210
|
+
If you have found clustvartools useful in your work, research, or company, please let us know by writing to email [djifacklab@gmail.com](mailto:djifacklab@gmail.com).
|
|
211
|
+
|
|
212
|
+
### Citing clustvartools <a name="citing"></a>
|
|
213
|
+
|
|
214
|
+
If clustvartools has been significant in your research, and you would like to acknowledge the project in your academic publication, we suggest citing it using the following *BibTeX format*:
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
@misc{DJIFACK ZEBAZE_2026,
|
|
218
|
+
url = {https://github.com/enfantbenidedieu/clustvartools},
|
|
219
|
+
title = {clustvartools: Clustering of Variables with Python}
|
|
220
|
+
author = {DJIFACK ZEBAZE, Duvérier},
|
|
221
|
+
year = {2026}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./docs/source/_static/clustvartools.svg" height=300></img>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
|
|
7
|
+
[](https://github.com/enfantbenidedieu/clustvartools/blob/master/LICENSE)
|
|
8
|
+
[](https://pypi.org/project/clustvartools/)
|
|
9
|
+
[](https://pepy.tech/project/clustvartools)
|
|
10
|
+
[](https://pepy.tech/project/clustvartools)
|
|
11
|
+
[](https://pepy.tech/project/clustvartools)
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
# clustvartools : Clustering of Variables with Python
|
|
16
|
+
|
|
17
|
+
# Contents
|
|
18
|
+
|
|
19
|
+
**1. [Overview](#overview)**
|
|
20
|
+
|
|
21
|
+
**2. [Installation](#installation)**
|
|
22
|
+
|
|
23
|
+
* [2.1 Global environmen](#genv)
|
|
24
|
+
* [2.2 Virtual environment](#venv)
|
|
25
|
+
* [2.3 Version](#version)
|
|
26
|
+
* [2.4 Dependencies](#dependencies)
|
|
27
|
+
|
|
28
|
+
**3. [Example](#example)**
|
|
29
|
+
|
|
30
|
+
**4. [Documentation](#doc)**
|
|
31
|
+
|
|
32
|
+
**5. [About us](#about_us)**
|
|
33
|
+
|
|
34
|
+
* [5.1 Authors](#authors)
|
|
35
|
+
* [5.2 Feedbacks](#authors)
|
|
36
|
+
* [5.3 Citing clustvartools](#citing)
|
|
37
|
+
|
|
38
|
+
## Overview <a name="overview"></a>
|
|
39
|
+
|
|
40
|
+
clustvartools is a python library for clustering of variables. It provides functions for :
|
|
41
|
+
|
|
42
|
+
1. **Cluster Analysis**
|
|
43
|
+
|
|
44
|
+
1. *CatCLV* - Hierarchical Clustering of Categorical Variables around Latent Variables
|
|
45
|
+
2. *CatHCAV* - Hierarchical Clustering Analysis of Categorical Variables
|
|
46
|
+
3. *CatVARHCA* - Categorical Variables Hierarchical Clustering Analysis
|
|
47
|
+
4. *CLV* - Hierarchical Clustering of Variables around Latent Variables
|
|
48
|
+
5. *CLVmix* - Hierarchical Clustering of Mixed Variables around Latent Variables
|
|
49
|
+
6. *CorCLV* - Hierarchical Clustering of Variables from a covariance/correlation matrix
|
|
50
|
+
7. *DCLV* - Divisive Clustering of Variables around Latent Variables
|
|
51
|
+
8. *HCAV* - Hierarchical Clustering Analysis for Variables
|
|
52
|
+
9. *HCAVmix* - Hierarchical Clustering Analysis of Variables for Mixed Data
|
|
53
|
+
|
|
54
|
+
4. In some methods, it allowed to add supplementary variables.
|
|
55
|
+
5. It provides a geometrical point of view.
|
|
56
|
+
6. It provides efficient implementations, using a scikit-learn API.
|
|
57
|
+
|
|
58
|
+
## Installation <a name="installation"></a>
|
|
59
|
+
|
|
60
|
+
### Global environment <a name="genv"></a>
|
|
61
|
+
|
|
62
|
+
You can directly install clustvartools using pip :
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install clustvartools
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
or set a virtual environment.
|
|
69
|
+
|
|
70
|
+
### Virtual environment <a name="venv"></a>
|
|
71
|
+
|
|
72
|
+
Install the 64-bit version of Python 3, for instance from the [official website](https://www.python.org/). Now create a [virtual environment (venv)](https://docs.python.org/3/tutorial/venv.html) and install clustvartools.
|
|
73
|
+
|
|
74
|
+
The virtual environment is optional but strongly recommended, in order to avoid potential conflicts with other packages.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
PS C:\> python -m venv clustvartools-env # create virtual env
|
|
78
|
+
PS C:\> clustvartools-env\Scripts\activate # activate
|
|
79
|
+
PS C:\> pip install -U clustvartools # install clustvartools
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Version <a name="version"></a>
|
|
83
|
+
|
|
84
|
+
In order to check your installation, you can use.
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
>>> import clustvartools
|
|
88
|
+
>>> print(clustvartools.__version__)
|
|
89
|
+
0.0.1
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Using an isolated environment such as *pip venv* or *conda* makes it possible to install a specific version of clustvartools with pip and conda and its dependencies independently of any previously installed Python packages.
|
|
93
|
+
|
|
94
|
+
You should always remember to activate the environment of your choice prior to running any Python command whenever you start a new terminal session.
|
|
95
|
+
|
|
96
|
+
### Dependencies <a name="dependencies"></a>
|
|
97
|
+
|
|
98
|
+
clustvartools is compatible with python version which supports both dependencies :
|
|
99
|
+
|
|
100
|
+
| Packages | Version |
|
|
101
|
+
| :---------------- | :------: |
|
|
102
|
+
| numpy | 1.21 |
|
|
103
|
+
| pandas | 1.4 |
|
|
104
|
+
| scikit-learn | 1.2 |
|
|
105
|
+
| statsmodels | 0.14.6 |
|
|
106
|
+
| plotnine | 0.10.1 |
|
|
107
|
+
| openpyxl | 3.1.5 |
|
|
108
|
+
| adjustText | 0.8.2 |
|
|
109
|
+
| pyreadr | 0.5.4 |
|
|
110
|
+
| mizani | 0.14.4 |
|
|
111
|
+
| tabulate | 0.9.0 |
|
|
112
|
+
|
|
113
|
+
## Example <a name="example"></a>
|
|
114
|
+
|
|
115
|
+
1. **Loading data**
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
>>> from clustvartools.datasets import decathlon
|
|
119
|
+
>>> data = decathlon.data
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
2. **Clustering of variables around Latent Variables (CLV)**
|
|
123
|
+
|
|
124
|
+
```python
|
|
125
|
+
>>> from clustvartools import CLV
|
|
126
|
+
>>> clf = CLV(ncl=3,sup_var=(10,11,12))
|
|
127
|
+
>>> clf.fit(data)
|
|
128
|
+
CLV(ncl=3,sup_var=(10,11,12))
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
3. **Visualize dendrogram**
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
>>> from clustvartools import fviz_dend
|
|
135
|
+
>>> p = fviz_dend(obj=clf,color_labels_by_cluster=True,rect = True,rect_fill = True,color_labels_by_cluster=True,text_size=12,text_height=True,nudge_y=-0.03)
|
|
136
|
+
>>> print(p.show())
|
|
137
|
+
```
|
|
138
|
+
<center>
|
|
139
|
+
<img src="./docs/source/_static/fviz_dend_fill.png" alt="centered image"/>
|
|
140
|
+
</center>
|
|
141
|
+
|
|
142
|
+
4. **Extract results**
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
>>> # extract the results for variables
|
|
146
|
+
>>> quanti_var = clf.quanti_var_
|
|
147
|
+
>>> quanti_var._fields
|
|
148
|
+
... ('cluster','cor','cortest','sqload','member','sim','loadings')
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Documentation <a name="doc"></a>
|
|
152
|
+
|
|
153
|
+
The official documentation is hosted on [https://clustvartools.readthedocs.io](https://clustvartools.readthedocs.io).
|
|
154
|
+
|
|
155
|
+
## About Us <a name="about_us"></a>
|
|
156
|
+
|
|
157
|
+
### Authors <a name="authors"></a>
|
|
158
|
+
|
|
159
|
+
clustvartools is developed and maintained by [Duvérier DJIFACK ZEBAZE](https://www.linkedin.com/in/duv%C3%A9rier-djifack-z-030097118/), the founder of djifacklab (*Djifack Laboratory of Mathematics, Statistics and Economics books and packages production using Python Programming Language*).
|
|
160
|
+
|
|
161
|
+
The djifacklab laboratory maintains others python librairies such as [scientisttools](https://pypi.org/project/scientisttools/), [discrimintools](https://pypi.org/project/discrimintools/), [scientistmetrics](https://pypi.org/project/scientistmetrics/), [scientistshiny](https://pypi.org/project/scientistshiny/), [scientisttseries](https://pypi.org/project/scientistshiny/) and [ggcorrplot]( https://pypi.org/project/ggcorrplot/).
|
|
162
|
+
|
|
163
|
+
### Feedbacks <a name="feedbacks"></a>
|
|
164
|
+
|
|
165
|
+
If you have found clustvartools useful in your work, research, or company, please let us know by writing to email [djifacklab@gmail.com](mailto:djifacklab@gmail.com).
|
|
166
|
+
|
|
167
|
+
### Citing clustvartools <a name="citing"></a>
|
|
168
|
+
|
|
169
|
+
If clustvartools has been significant in your research, and you would like to acknowledge the project in your academic publication, we suggest citing it using the following *BibTeX format*:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
@misc{DJIFACK ZEBAZE_2026,
|
|
173
|
+
url = {https://github.com/enfantbenidedieu/clustvartools},
|
|
174
|
+
title = {clustvartools: Clustering of Variables with Python}
|
|
175
|
+
author = {DJIFACK ZEBAZE, Duvérier},
|
|
176
|
+
year = {2026}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from ._catclv import CatCLV
|
|
5
|
+
from ._cathcav import CatHCAV
|
|
6
|
+
from ._catvarhca import CatVARHCA
|
|
7
|
+
from ._clv import CLV
|
|
8
|
+
from ._clvmix import CLVmix
|
|
9
|
+
from ._corclv import CorCLV
|
|
10
|
+
from ._dclv import DCLV
|
|
11
|
+
from ._hcav import HCAV
|
|
12
|
+
from ._hcavmix import HCAVmix
|
|
13
|
+
|
|
14
|
+
__all__ = [
|
|
15
|
+
"CatCLV",
|
|
16
|
+
"CatHCAV",
|
|
17
|
+
"CatVARHCA",
|
|
18
|
+
"CLV",
|
|
19
|
+
"CLVmix",
|
|
20
|
+
"CorCLV",
|
|
21
|
+
"DCLV",
|
|
22
|
+
"HCAV",
|
|
23
|
+
"HCAVmix"
|
|
24
|
+
]
|