[scikit-learn] KMeans default distance function

prince gosavi princegosavi12 at gmail.com
Sat Mar 10 06:32:06 EST 2018


Hi,

I am using KMeans for clustering purpose on my data.

I am interested in the distance function used by KMeans for creating
clusters and determining the cluster points.
I have read the
http://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html#sklearn-cluster-kmeans
documentation but was not able to find the method used.

If possible please give a example as to how it is done.

from sklearn.cluster import KMeans
KMeans(max_iter=4,n_clusters=10,n_init=10).fit(X)

where X has 14 features lets say for example
[0, 0, 2, 8, 0, 0, 3, 16, 8, 39, 1, 0, 0, 2]
[0, 0, 3, 9, 0, 0, 3, 1, 8, 9, 1, 0, 0, 1]

Also if you can show me how KMeans can be implemented on my data it would
certainly help.

-- 
Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20180310/b8e889fa/attachment.html>


More information about the scikit-learn mailing list