Project description
Some functions for clustering
Tested against Windows / Python 3.11 / Anaconda
pip install clusterzeug
from clusterzeug import (
birchcluster,
gaussianmixture,
opticscluster,
hdbscancluster,
dbscan,
agglomerativeclustering,
spectralclustering,
kmeanscluster,
minibatchkmeanscluster,
afinity_propagation,
mean_shift,
)
import numpy as np
import random
data = np.array(
[[random.randint(1, 1000), random.randint(1, 1000)] for _ in range(100)],
dtype=np.int64,
)
a1 = birchcluster(data, n_clusters=10)
a2 = gaussianmixture(data, n_components=5)
a3 = opticscluster(data, min_samples=5)
a4 = hdbscancluster(data, min_cluster_size=5)
a5 = dbscan(data, eps=0.5, min_samples=5)
a6 = agglomerativeclustering(data, n_clusters=10)
a7 = spectralclustering(data, n_clusters=10)
res = kmeanscluster(data, n_clusters=10)
print(res)
res2 = minibatchkmeanscluster(data, n_clusters=10)
print(res2)
aff = afinity_propagation(data, damping=0.5, preference=-10)
print(aff)
ms = mean_shift(data,bandwidth=2.0)
print(ms)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file clusterzeug-0.10.tar.gz
.
File metadata
-
Download URL:
clusterzeug-0.10.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
-
Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Hashes for clusterzeug-0.10.tar.gz
Algorithm |
Hash digest |
|
SHA256 |
358c62f02d152995ffa8173c3293818333941e80fffd59f562755da2bc5a6112 |
|
MD5 |
ebc9d4dda8bc329f6c3fbea02b06619c |
|
BLAKE2b-256 |
bfeae76ebb8e944c8fb3fda280e2110bbd84ea693e6104bf3eb368724efec8ce |
|
See more details on using hashes here.
File details
Details for the file clusterzeug-0.10-py3-none-any.whl
.
File metadata
-
Download URL:
clusterzeug-0.10-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
-
Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Hashes for clusterzeug-0.10-py3-none-any.whl
Algorithm |
Hash digest |
|
SHA256 |
c16824e37716a622be488df741fe08531aa1cbfadcec5b9e56f2998ef3fd7042 |
|
MD5 |
e5cc39b6877a34caf0ecf9f6dfec3041 |
|
BLAKE2b-256 |
4a4f2047de8e050a02fa3eb97b2d674e902045413aaed3d84822757a725e335a |
|
See more details on using hashes here.