clustvartools : Clustering of Variables with Python
Contents
1. Overview
2. Installation
3. Example
5. About us
Overview
clustvartools is a python library for clustering of variables. It provides functions for :
-
Cluster Analysis
- CatCLV - Hierarchical Clustering of Categorical Variables around Latent Variables
- CatHCAV - Hierarchical Clustering Analysis of Categorical Variables
- CatVARHCA - Categorical Variables Hierarchical Clustering Analysis
- CLV - Hierarchical Clustering of Variables around Latent Variables
- CLVmix - Hierarchical Clustering of Mixed Variables around Latent Variables
- CorCLV - Hierarchical Clustering of Variables from a covariance/correlation matrix
- DCLV - Divisive Clustering of Variables around Latent Variables
- HCAV - Hierarchical Clustering Analysis for Variables
- HCAVmix - Hierarchical Clustering Analysis of Variables for Mixed Data
-
In some methods, it allowed to add supplementary variables.
-
It provides a geometrical point of view.
-
It provides efficient implementations, using a scikit-learn API.
Installation
Global environment
You can directly install clustvartools using pip :
pip install clustvartools
or set a virtual environment.
Virtual environment
Install the 64-bit version of Python 3, for instance from the official website. Now create a virtual environment (venv) and install clustvartools.
The virtual environment is optional but strongly recommended, in order to avoid potential conflicts with other packages.
PS C:\> python -m venv clustvartools-env # create virtual env
PS C:\> clustvartools-env\Scripts\activate # activate
PS C:\> pip install -U clustvartools # install clustvartools
Version
In order to check your installation, you can use.
>>> import clustvartools
>>> print(clustvartools.__version__)
0.0.1.post1
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.
You should always remember to activate the environment of your choice prior to running any Python command whenever you start a new terminal session.
Dependencies
clustvartools is compatible with python version which supports both dependencies :
| Packages | Version |
|---|---|
| numpy | 1.21 |
| pandas | 1.4 |
| scikit-learn | 1.2 |
| statsmodels | 0.14.6 |
| plotnine | 0.10.1 |
| openpyxl | 3.1.5 |
| adjustText | 0.8.2 |
| pyreadr | 0.5.4 |
| mizani | 0.14.4 |
| tabulate | 0.9.0 |
Example
- Loading data
>>> from clustvartools.datasets import decathlon
>>> data = decathlon.data
- Clustering of variables around Latent Variables (CLV)
>>> from clustvartools import CLV
>>> clf = CLV(ncl=3,sup_var=(10,11,12))
>>> clf.fit(data)
CLV(ncl=3,sup_var=(10,11,12))
- Visualize dendrogram
>>> from clustvartools import fviz_dend
>>> 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)
>>> print(p.show())
- Extract results
>>> # extract the results for variables
>>> quanti_var = clf.quanti_var_
>>> quanti_var._fields
... ('cluster','cor','cortest','sqload','member','sim','loadings')
Documentation
The official documentation is hosted on https://clustvartools.readthedocs.io.
About Us
Authors
clustvartools is developed and maintained by Duvérier DJIFACK ZEBAZE, the founder of djifacklab (Djifack Laboratory of Mathematics, Statistics and Economics books and packages production using Python Programming Language).
The djifacklab laboratory maintains others python librairies such as scientisttools, discrimintools, scientistmetrics, scientistshiny, scientisttseries and ggcorrplot.
Feedbacks
If you have found clustvartools useful in your work, research, or company, please let us know by writing to email djifacklab@gmail.com.
Citing clustvartools
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:
@misc{DJIFACK ZEBAZE_2026,
url = {https://github.com/enfantbenidedieu/clustvartools},
title = {clustvartools: Clustering of Variables with Python}
author = {DJIFACK ZEBAZE, Duvérier},
year = {2026}
}
Release files for clustvartools 0.0.1.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| clustvartools-0.0.1.post1.tar.gz | 283.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clustvartools-0.0.1.post1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 600.9 kB
Release files / clustvartools-0.0.1.post1.tar.gz
| Download URL | clustvartools-0.0.1.post1.tar.gz |
|---|---|
| Size | 283.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d21b80054078b40a61e397cb93f112e4ead2c32f9b7884e68f1ac54ba441de4
|
|
BLAKE2b-256 checksum How to use checksums |
b966b0f1d06f05c253477f1f19425d57cd34a375ea29f7b1bccfaecbd71ad12b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.0
|
Release files / clustvartools-0.0.1.post1-py3-none-any.whl
| Download URL | clustvartools-0.0.1.post1-py3-none-any.whl |
|---|---|
| Size | 317.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
655bc58545d81935987cbb6710f35ec43d5078cd43dc1ba144e4cdfc918a449d
|
|
BLAKE2b-256 checksum How to use checksums |
92ac7ec69772356722fd32b852d50776aedcae700ba9ba73f44b15a1b2239bda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.0
|