K-Means: assignment step
Beginner classical-mlunsupervisedclusteringkmeans
Implement:
def kmeans_assign(input: np.ndarray, centroids: np.ndarray) -> np.ndarray:
"""Returns shape (n_samples,): index of the nearest centroid per sample."""
- Reuse
01-knn's pairwise_distances, don't recompute distances by hand.