I have clusters as shown in the picture below.data to cluster.Note: the clusters are visually separable.

The data is 2d : the two parameters are error and time. I tried using the following clustering algorithms: 1) kmeans:clusters are spherical. This algo clustered as follows:clustering with kmeans. Kmeans did form clusters as needed. 2)dbscan: problem- I have clusters of varying density. It assigned every data point to noisy cluster I.e. it assigned a label of -1 to every point. 3) GMM: this also did not cluster the data points as needed. It performed clustering similar to kmeans. 4)affinity propagation is throwing a memory error.

Can someone please suggest a way of assigning different labels to each of the visually separable cluster.

  • $\begingroup$ can you please provide your code - with out seeing what you are doing its hard to give an advice. $\endgroup$
    – El Burro
    Commented Jun 19, 2019 at 13:49

1 Answer 1

  1. Scaling matters. The y values will be ignored because of the x axis.

  2. Parameters matter. You probably used DBSCAN with the sklearn default parameter values which are utter nonsense for anything but 2d normalized toy data.

  3. Asking the right question matters. What are clusters here supposed to be anyway? I don't see any clusters. You show a time series with plenty of missing data, but there are no clusters. You seem to want to split your time series where you have missing values, but that is not clustering. You likely can abuse clustering such as DBSCAN here (just try minpts=1, epsilon=100 or similar) but that is an incredibly inefficient way to solve this, because you abuse a multivariate approach for a trivial one-dimensional problem.

Sort by time. If the next timestamp is much larger than the previous, this is the end of a subintervals (I wouldn't call these clusters). That is easily done with a for loop.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.