Meta-inspired content-clustering pipeline has a set of candidate centroids and needs to assign each embedding to its closest cluster. You need to perform the assignment step correctly so the clustering loop can continue.
Assign every embedding (row of X) to the closest centroid (row of C) using squared Euclidean distance. On a tie the lower centroid index wins.
Implement solve(X,C).
Returns. Return an integer NumPy array with one centroid index per embedding.
Example 1
Input:
solve([[0, 0], [10, 0]], [[0, 1], [9, 0]])
Output:
[0, 1]
Example 2
Input:
solve([[1.0, 1.0]], [[0.0, 0.0], [2.0, 2.0]])
Output:
[0]
No results yet
Run your code to check it against the examples, or submit to run every test.