K-Means ClusteringMedium
k-Means++ Seeding from Given Draws
~18 mincode completion
Implement kmeanspp_seed(X, first, draws) returning the array of chosen centroids, in the order chosen.
Where this shows up
~18 min
••
1 employer weight this skill
1 health and bio company. Top match scores 85.
Python
import numpy as np
def kmeanspp_seed(X, first, draws):
"""
k-means++ initialization with the random draws supplied.
Args:
X: array of shape (n, d)
first: index of the first centroid
draws: array of uniform numbers in [0, 1), one per extra centroid
Returns:
array of shape (len(draws) + 1, d): the centroids in the order chosen
"""
# YOUR CODE HERE
pass