I have a 4 dimensional data set, say X. Which happens to be the iris dataset. I form a sub list of 10 data points from this set, called mu. For each of these 10 data points, I am to calculate the sum of the 10 smallest squared distances of points in mu to their closest neighbor. Closest neighbors here could include data points from the original data set. How am I to achieve the same?
I think I could use something like this -
(np.array([min([np.linalg.norm(x-c)**2 for x in X]) for c in mu]))
But 'x' here wouldn't exclude the very point under consideration ('c'), would it?