Skip to main content

pyclustertend

Build Status PyPi Status Documentation Status Downloads codecov DOI

pyclustertend is a Python package specialized in cluster tendency. Cluster tendency consist to assess if clustering algorithms are relevant for a dataset.

Three methods for assessing cluster tendency are currently implemented and one additional method based on metrics obtained with a KMeans estimator:

  • Hopkins Statistics 1
  • VAT 2
  • iVAT 3
  • Metric based method (Silhouette 4, Calinski-Harabasz 5, Davies-Bouldin 6)

Installation

The package is available on PyPi and can be installed using pip:

pip install pyclustertend

Usage

Example Hopkins

    >>> from sklearn import datasets
    >>> from pyclustertend import hopkins
    >>> from sklearn.preprocessing import scale
    >>> X = scale(datasets.load_iris().data)
    >>> hopkins(X,150)
    0.18950453452838564

Example VAT

    >>> from sklearn import datasets
    >>> from pyclustertend import vat
    >>> from sklearn.preprocessing import scale
    >>> X = scale(datasets.load_iris().data)
    >>> vat(X)

Example iVat

    >>> from sklearn import datasets
    >>> from pyclustertend import ivat
    >>> from sklearn.preprocessing import scale
    >>> X = scale(datasets.load_iris().data)
    >>> ivat(X)

Notes

It's preferable to scale the data before using hopkins or vat algorithm as they use distance between observations. Moreover, vat and ivat algorithms do not really fit to massive databases. A first solution is to sample the data before using those algorithms.

  1. Hopkins, Brian; Skellam, J.G. (1954). "A new method for determining the type of distribution of plant individuals". Annals of Botany. 18 (2). Annals Botany Co: 213–227. doi:10.1093/oxfordjournals.aob.a083391 ↩

  2. Bezdek, James C.; Hathaway, Richard J. (2002). "VAT: A Tool for Visual Assessment of (Cluster) Tendency". Proceedings of the 2002 International Joint Conference on Neural Networks. IJCNN '02. IEEE Computer Society. pp. 2225–2230. doi:10.1109/IJCNN.2002.1007487. ↩

  3. Wang, L., Nguyen, U. T., Bezdek, J. C., Leckie, C. A., Ramamohanarao, K. (2010). "iVAT and aVAT: enhanced visual analysis for cluster tendency assessment". In Advances in Knowledge Discovery and Data Mining. PAKDD 2010 (pp. 16-27). Berlin, Heidelberg: Springer Berlin Heidelberg. doi:10.1007/978-3-642-13657-3_5. ↩

  4. Rousseeuw, Peter J. (1987). "Silhouettes: a Graphical Aid to the Interpretation and Validation of Cluster Analysis". Computational and Applied Mathematics. 20: 53–65. doi:10.1016/0377-0427(87)90125-7. ↩

  5. Caliński, Tadeusz; Harabasz, Jerzy (1974). "A dendrite method for cluster analysis". Communications in Statistics. 3 (1): 1–27. doi:10.1080/03610927408827101 ↩

  6. Davies, David L.; Bouldin, Donald W. (1979). "A Cluster Separation Measure". IEEE Transactions on Pattern Analysis and Machine Intelligence. PAMI-1 (2): 224–227. doi:10.1109/TPAMI.1979.4766909 ↩

Metadata

Release files for pyclustertend 1.10.0

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

Source distribution (sdist)

Source distribution for pyclustertend 1.10.0
File Size Uploaded Provenance Actions
pyclustertend-1.10.0.tar.gz 7.0 kB Without provenance Details for pyclustertend-1.10.0.tar.gz

Built distribution (wheel)

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

Total release size: 15.5 kB

Release files / pyclustertend-1.10.0.tar.gz

Download URL pyclustertend-1.10.0.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3555e6d76fd027611fb620d5e923f48ac5375ba849b0532f24439b4ba84d7c1c
BLAKE2b-256 checksum
How to use checksums
0c47d4ffd004365dd17b51240a7ff33345ec7dcf72144a5e52393ae01792922c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.3 Linux/6.17.0-1022-azure

Release files / pyclustertend-1.10.0-py3-none-any.whl

Download URL pyclustertend-1.10.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc50e1cf52cb0dc8b09c926071a81aebb164852f004fa61bd8adcda19d19a1a1
BLAKE2b-256 checksum
How to use checksums
4b8545eff7590e61e7657a9aeb6e1488722095e00897b6ef135f8cd8ca57d8c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.3 Linux/6.17.0-1022-azure

Security for pyclustertend 1.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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