Clusteval provides methods for unsupervised cluster validation
Project description
clusteval
- clusteval is Python package for unsupervised cluster evaluation. Five methods are implemented that can be used to evalute clusterings; silhouette, dbindex, derivative, dbscan and hdbscan.
Methods
out = clusteval.fit(X, ) clusteval.plot(out, X)
Contents
Installation
- Install clusteval from PyPI (recommended). clusteval is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows.
- It is distributed under the MIT license.
Requirements
- It is advisable to create a new environment.
conda create -n env_clusteval python=3.6
conda activate env_clusteval
pip install matplotlib numpy pandas tqdm seaborn hdbscan sklearn
Quick Start
pip install clusteval
- Alternatively, install clusteval from the GitHub source:
git clone https://github.com/erdogant/clusteval.git
cd clusteval
python setup.py install
Import clusteval package
import clusteval as clusteval
Create example data set
# Generate some random data
from sklearn.datasets import make_blobs
[X,_] = make_blobs(n_samples=750, centers=4, n_features=2, cluster_std=0.5)
Cluster validation using Silhouette score
# Determine the optimal number of clusters
out = clusteval.fit(X, method='silhouette')
fig = clusteval.plot(out, X)
Cluster validation using davies-boulin index
# Determine the optimal number of clusters
out = clusteval.fit(X, method='dbindex')
fig = clusteval.plot(out, X)
Cluster validation using derivative method
# Determine the optimal number of clusters
out = clusteval.fit(X, method='derivative')
fig = clusteval.plot(out)
Cluster validation using hdbscan
# Determine the optimal number of clusters
out = clusteval.fit(X, method='hdbscan')
fig = clusteval.plot(out)
Cluster validation using dbscan
# Determine the optimal number of clusters
out = clusteval.fit(X, method='hdbscan')
fig = clusteval.plot(out, X)
Citation
Please cite clusteval in your publications if this is useful for your research. Here is an example BibTeX entry:
@misc{erdogant2019clusteval,
title={clusteval},
author={Erdogan Taskesen},
year={2019},
howpublished={\url{https://github.com/erdogant/clusteval}},
}
Maintainers
- Erdogan Taskesen, github: erdogant
Contribute
- Contributions are welcome.
© Copyright
See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
clusteval-0.1.0.tar.gz
(32.4 kB
view hashes)
Built Distribution
clusteval-0.1.0-py3-none-any.whl
(25.3 kB
view hashes)
Close
Hashes for clusteval-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca2feb918feab44918f620038d301067c1fbf2ac9df42205f95e48ef20018b39 |
|
MD5 | d9b04389723d45a3bc34e51a7d9bde56 |
|
BLAKE2b-256 | 0c32aa3f2d060ac9dbd4bea9b8243274b674a61a1bd2ab362c7bdb1550d66417 |