SciPy - Clustering and Distance
Given the code below, what will be the output of the variable
idx?import numpy as np from scipy.cluster.vq import kmeans, vq data = np.array([[1, 2], [1, 4], [1, 0], [10, 2], [10, 4], [10, 0]]) centroids, _ = kmeans(data, np.array([[1, 2], [10, 2]])) idx, _ = vq(data, centroids) print(idx)
