Gianluca Mauro
1 min readMay 10, 2017

--

Sure! I used a standard kmeans implementation from sklearn. K-means doesn’t explicitly compute distances between datapoints, what it does is trying to minimize the within-cluster sum of squares, which however is equal to the sum of pairwise Euclidean distances divided by the number of points. In that sense, we can say that it uses Euclidean distance. I know that you can make it work with other criterions but convergence is not guaranteed and are therefore rarely used.

References on sklearn documentation.

Hope it’s useful!

--

--

Gianluca Mauro
Gianluca Mauro

Written by Gianluca Mauro

Founder of AI Academy and author of Zero to AI. On a mission to empower organizations and people to prosper in the AI era.

No responses yet