Clustering Package
An optimized implementation of VAT/IVAT, including priority-queue MST speedups as discussed at the NAFIPS 2025/2026 conferences. In addition, there are now C-based SIMD extensions which can improve the performance again by a factor of 15-20.
Installation
pip install tribble-clustering
Usage
For fuzzy-c-means:
from tribbleclustering import fuzzy_c_means
import numpy as np
data = np.array([[1, 2], [2, 3], [10, 11], [11, 12]])
membership, centers = fuzzy_c_means(data, n=2, m=2.0)
print(f"Cluster centers: {centers}")
print(f"Membership matrix:\n{membership}")
For IVAT:
from tribbleclustering import compute_ivat
from tribbleclustering.util import circle_random_clusters, pairwise_distances
cluster_cities = circle_random_clusters(10, 2, 10)
city_distances = pairwise_distances(cluster_cities)
print(compute_ivat(city_distances))
For K-Means (scikit-learn-compatible interface):
from tribbleclustering import KMeans
import numpy as np
data = np.array([[1, 2], [2, 3], [10, 11], [11, 12]])
model = KMeans(n_clusters=2, random_state=0).fit(data)
print(f"Cluster centers: {model.cluster_centers_}")
print(f"Labels: {model.labels_}")
For ConiVAT (semi-supervised iVAT with must-link/cannot-link constraints):
from tribbleclustering import ConiVAT
import numpy as np
data = np.array([[1, 2], [2, 3], [10, 11], [11, 12]])
labels = np.array([0, 0, 1, 1]) # used only to sample constraints
model = ConiVAT(n_clusters=2).fit(data, y=labels)
print(f"Cluster centers: {model.cluster_centers_}")
print(f"Labels: {model.labels_}")
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tribble_clustering-0.3.0.tar.gz
(687.2 kB
view details)
File details
Details for the file tribble_clustering-0.3.0.tar.gz.
File metadata
- Download URL: tribble_clustering-0.3.0.tar.gz
- Upload date:
- Size: 687.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9b1c4656993b75d6c425564fab2d03766d28323a60fad4e24484519e89c0ead
|
|
| MD5 |
4936971c215e544b7743401585c8920c
|
|
| BLAKE2b-256 |
7e1f20853dd38d47229f26de13d44d16b5f51e065a58653b508521c69ca28de8
|
Provenance
The following attestation bundles were made for tribble_clustering-0.3.0.tar.gz:
Publisher:
publish.yaml on fundthmcalculus/clustering
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tribble_clustering-0.3.0.tar.gz -
Subject digest:
d9b1c4656993b75d6c425564fab2d03766d28323a60fad4e24484519e89c0ead - Sigstore transparency entry: 2655224499
- Sigstore integration time:
-
Permalink:
fundthmcalculus/clustering@1ec96674f8e0582b9761e07c3bf735f32bc96db6 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/fundthmcalculus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@1ec96674f8e0582b9761e07c3bf735f32bc96db6 -
Trigger Event:
push
-
Statement type: