scipy - Spherical k-means implementation in Python -


i've been using scipy's k-means quite time now, , i'm pretty happy way works in terms of usability , efficiency. however, want explore different k-means variants, more specifically, i'd apply spherical k-means in of problems.

do know python implementation (i.e. similar scipy's k-means) of spherical k-means? if not, how hard modify scipy's source code adapt k-means algorithm spherical?

thank you.

changing distance function in k-means (to cosine) not sufficient since in spherical k-means, aim guarantee centers on sphere.

specifically, centers should normalized after each maximization step. indeed, when centers , data points both normalized, there 1-to-1 relationship between cosine dist , euclidian dist

|a - b|_2 = 2 * (1 - cos(a,b)) 

there new package, clara-labs/spherecluster converts scikit's k-means spherical k-means , provides sphere clustering algorithm.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -