Solved – k-means for one-dimensional dataset

clusteringk-means

I am using k-means clustering algorithm to cluster one-dimensional numeric data set.
As far as I know k-means is sensitive to the initialization of the centroids. However, in my case I get the same result, no matter which centroids have been chosen.

Is it because I am clustering one-dimensional dataset ?

Is it safe to say that k-means is not sensitive in case of one-dimensional clustering ?

Best Answer

It could also be because your clusters are particularly well separated. Plot your data to see the clusters. With one dimension that's very intuitive (to the point that you almost don't need an algorithm).