Skip to content

Conversation

pedramr
Copy link

@pedramr pedramr commented Jun 22, 2025

Running the example:

Clustering 10000 vectors of dimension 64 into 10 clusters

Running simple k-means clustering...
Simple k-means completed in 8.759083ms
Average quantization error: 2698.03

Running clustering with custom parameters...
Sampling a subset of 2560 / 10000 for training
Clustering 2560 points in 64D to 10 clusters, redo 3 times, 25 iterations
  Preprocessing in 0.00 s
Outer iteration 0 / 3
  Iteration 24 (0.01 s, search 0.00 s): objective=2.69803e+07 imbalance=1.296 nsplit=0
Objective improved: keep new clusters
Outer iteration 1 / 3
  Iteration 24 (0.01 s, search 0.01 s): objective=3.06187e+07 imbalance=1.357 nsplit=0
Outer iteration 2 / 3
  Iteration 24 (0.02 s, search 0.01 s): objective=2.0157e+07 imbalance=1.134 nsplit=0
Objective improved: keep new clusters

Advanced clustering completed in 19.593958ms

Comparing clustering quality...
Average distance to nearest centroid:
  Simple k-means:   10705.22
  Advanced method:  8305.35
  Improvement:      22.42% better

Time comparison:
  Simple:   8.759083ms
  Advanced: 19.593958ms (2.2x slower due to multiple runs)

Running the example:
```
Clustering 10000 vectors of dimension 64 into 10 clusters

Running simple k-means clustering...
Simple k-means completed in 8.759083ms
Average quantization error: 2698.03

Running clustering with custom parameters...
Sampling a subset of 2560 / 10000 for training
Clustering 2560 points in 64D to 10 clusters, redo 3 times, 25 iterations
  Preprocessing in 0.00 s
Outer iteration 0 / 3
  Iteration 24 (0.01 s, search 0.00 s): objective=2.69803e+07 imbalance=1.296 nsplit=0
Objective improved: keep new clusters
Outer iteration 1 / 3
  Iteration 24 (0.01 s, search 0.01 s): objective=3.06187e+07 imbalance=1.357 nsplit=0
Outer iteration 2 / 3
  Iteration 24 (0.02 s, search 0.01 s): objective=2.0157e+07 imbalance=1.134 nsplit=0
Objective improved: keep new clusters

Advanced clustering completed in 19.593958ms

Comparing clustering quality...
Average distance to nearest centroid:
  Simple k-means:   10705.22
  Advanced method:  8305.35
  Improvement:      22.42% better

Time comparison:
  Simple:   8.759083ms
  Advanced: 19.593958ms (2.2x slower due to multiple runs)
```
@pedramr pedramr force-pushed the pedramr/clustring-binding branch from 9894a40 to 6fefd6e Compare September 19, 2025 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant