Clustering not working as expected I have clusters as shown in the picture below.

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:.
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.
Scaling matters. The y values will be ignored because of the x axis.
Parameters matter. You probably used DBSCAN with the sklearn default parameter values which are utter nonsense for anything but 2d normalized toy data.
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.