computing complexity of kmeans algorithm -
i want compute complexity of kmeans algorithm based on complexity theory.
i have read standard algorithm of kmeans wikipedia: link
if (you haven't understood k-means) http://home.deib.polimi.it/matteucc/clustering/tutorial_html/kmeans.html
else
initialize means (e.g. picking k samples @ random)
• iterate: (i times)
(1) assign each point nearest mean
(2) move “mean” center of cluster.
(3) finally, algorithm aims @ minimizing objective function, in case squared error function. objective function has complexity of kn see definition.if there m attributes (in place of normal euclidean function time in calculating objective function proportional m)
time complexity of k-means
• let tdist time calculate distance between 2 objects
• each iteration time complexity: o(kntdist)
k = number of clusters (centroids) n = number of objects
• bound number of iterations giving o(ikntdist)
• m-dimensional vectors: o(iknm) ----------------> answer
( m large , centroids not sparse )
space complexity of k-means
• store points , centroids
– vector model: o((n + k)m)---------------------->space complexity
Comments
Post a Comment