Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,11 @@ KMeansIntermediate clusterAndSplit(final FloatVectorValues vectors, final int ta
// TODO: consider adding cluster size counts to the kmeans algo
// handle assignment here so we can track distance and cluster size
int[] centroidVectorCount = new int[centroids.length];
int effectiveK = 0;
for (int assigment : assignments) {
centroidVectorCount[assigment]++;
}

int effectiveK = 0;
for (int j : centroidVectorCount) {
if (j > 0) {
// this cluster has received an assignment, its now effective, but only count it once
if (centroidVectorCount[assigment] == 1) {
effectiveK++;
}
}
Expand Down