What clustering algorithm to use on 1-d data? [clo

2019-03-01 00:55发布

问题:

I have a list of numbers in an array. The index of each element is X and the value is Y. How do i go about partitioning/clustering this data? If i had an array, i just want a set of values which mark the end of each partition. Since I'm working on Python, please do mention if there are libraries to do the same.

Thanks.

回答1:

K-Means is a very simple clustering algorithm, I would say the first to test before going for more complex things. The K-Means algorithm http://en.wikipedia.org/wiki/K-means_clustering

Proper K-Means initialization is strongly advised http://en.wikipedia.org/wiki/K-means%2B%2B, as it.

If you're not happy with K-Means, then you use EM algorithm with Gaussian mix ( http://en.wikipedia.org/wiki/Mixture_model ), not too hard to code and you can use K-Means to initialize it !

Those have been implemented 100 times in Python, check any machine learning toolbox.