Skip to main content

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)

Uploaded Source

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

Hashes for tribble_clustering-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d9b1c4656993b75d6c425564fab2d03766d28323a60fad4e24484519e89c0ead
MD5 4936971c215e544b7743401585c8920c
BLAKE2b-256 7e1f20853dd38d47229f26de13d44d16b5f51e065a58653b508521c69ca28de8

See more details on using hashes here.

Provenance

The following attestation bundles were made for tribble_clustering-0.3.0.tar.gz:

Publisher: publish.yaml on fundthmcalculus/clustering

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 file

0.1.8

1 file

0.1.7

1 file

0.1.6

1 file

0.1.4

1 file

0.1.3

1 file

0.1.0

2 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