Skip to main content

GitHub PyPI Downloads Downloads Downloads

clustvartools : Clustering of Variables with Python

Contents

1. Overview

2. Installation

3. Example

4. Documentation

5. About us

Overview

clustvartools is a python library for clustering of variables. It provides functions for :

  1. Cluster Analysis

    1. CatCLV - Hierarchical Clustering of Categorical Variables around Latent Variables
    2. CatHCAV - Hierarchical Clustering Analysis of Categorical Variables
    3. CatVARHCA - Categorical Variables Hierarchical Clustering Analysis
    4. CLV - Hierarchical Clustering of Variables around Latent Variables
    5. CLVmix - Hierarchical Clustering of Mixed Variables around Latent Variables
    6. CorCLV - Hierarchical Clustering of Variables from a covariance/correlation matrix
    7. DCLV - Divisive Clustering of Variables around Latent Variables
    8. HCAV - Hierarchical Clustering Analysis for Variables
    9. HCAVmix - Hierarchical Clustering Analysis of Variables for Mixed Data
  2. In some methods, it allowed to add supplementary variables.

  3. It provides a geometrical point of view.

  4. 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

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

  1. Loading data
>>> from clustvartools.datasets import decathlon
>>> data = decathlon.data
  1. 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))
  1. 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())
centered image
  1. 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

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clustvartools 0.0.1
File Size Uploaded
clustvartools-0.0.1.tar.gz 283.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clustvartools 0.0.1
File Interpreter ABI Platform
clustvartools-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 600.9 kB

Release files / clustvartools-0.0.1.tar.gz

Download URL clustvartools-0.0.1.tar.gz
Size 283.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6586fb173930f039564f8c17dab09f0de03de9667400affd0da0c3b246636b62
BLAKE2b-256 checksum
How to use checksums
06d2918d597606085e96fed51a391670550b3b3b4025370710cf897e2a42175a
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-py3-none-any.whl

Download URL clustvartools-0.0.1-py3-none-any.whl
Size 317.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b05c49c7ca70186bd7604e2ebfac375ad3637a65d5a8af2d2bf1c2feef210de0
BLAKE2b-256 checksum
How to use checksums
71226335bd27c62c93d9aef292fa6e71d14fdb44df9ad25da839c83c8d8fd37f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page