Seeded k-means (Basu, Banerjee and Mooney, 2002) starts each cluster from the mean of its labeled seeds. During the iterations, seeded points keep their label, and unlabeled points are assigned to their nearest centroid.
Implement seeded_kmeans(X, seeds, k, iters=100).
X is (N, d). seeds is (N,) with class indices 0..k-1 for seeded points and -1 for unlabeled points.iters rounds.(labels, centroids). labels is an integer array of length N, and centroids is (k, d).0..k-1 must have at least one seed. Otherwise raise ValueError.-1..k-1 raises ValueError.ValueError.k >= 1 and iters >= 1.Keep a boolean mask of seeded points and overwrite the assignments for those points after each nearest-centroid step.
No results yet
Run your code to check it against the examples, or submit to run every test.