I need help. I am creating a game like candy crush and i have to use k-means alghorithm in my game. But i have no idea how will i choose centers of clusters.How should i start and how should i proceed?
K-means and other clustering algorithms shine when you have multivariate data. They will “work” with 1-dimensional data, but they are not very smart anymore.
One-dimensional data is ordered. If you sort your data (or it even is already sorted), it can be processed much more efficiently than with k-means. Complexity of k-means is “just” O(nki), but if your data is sorted and 1-dimensional you can actually improve k-means to O(k*i). Sorting comes at a cost, but there are very good sort implementations everywhere…
Plus, for 1-dimensional data there is a lot of statistics you can use that are not very well researched or tractable on higher dimensions. One statistic you really should try is kernel density estimation. Maybe also try Jenks Natural Breaks Optimization.
However, if you want to just split your data into poor/medium/high, why don’t you just use two thresholds?
Thank you very much for informations ! Yes i just want split my data but unfortuanetly i have to use k-means for my school project. I think they want teach us K-means alghorithm. Thank you again.