You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
doesn't actually yield to the point that minimise the average custom distances within a cluster.
The mean is the optimal solution for the euclidian distance but not for an arbitrary distance. For instance, in the case of cosine distance, the mean calculated as above will give the optimum center of the cluster only if X rows are l2-normalised.
A more general solution would be to use sklearn_extra.cluster.KMedoids
The text was updated successfully, but these errors were encountered:
Hi, I think that there is an over-simplification in Custom Kmeans, the way the centroids are estimated:
centres[each_center] = np.mean(X[each_center_samples], axis=0)
doesn't actually yield to the point that minimise the average custom distances within a cluster.
The
mean
is the optimal solution for the euclidian distance but not for an arbitrary distance. For instance, in the case of cosine distance, themean
calculated as above will give the optimum center of the cluster only if X rows are l2-normalised.A more general solution would be to use sklearn_extra.cluster.KMedoids
The text was updated successfully, but these errors were encountered: