mirror of
https://github.com/muesli/kmeans.git
synced 2025-09-27 03:56:17 +08:00
Ensure another iteration after randomly assigning a point to a cluster
This commit is contained in:
@@ -85,6 +85,10 @@ func (m Kmeans) Partition(dataset clusters.Observations, k int) (clusters.Cluste
|
|||||||
}
|
}
|
||||||
cc[ci].Append(dataset[ri])
|
cc[ci].Append(dataset[ri])
|
||||||
points[ri] = ci
|
points[ri] = ci
|
||||||
|
|
||||||
|
// Ensure that we always see at least one more iteration after
|
||||||
|
// randomly assigning a data point to a cluster
|
||||||
|
changes = len(dataset)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user