Time series clustering on large data I am trying to do K-means clustering on my data which has time series length of 3700 and for (latitude,longitude) points of around 6000 in length. However, timeseries clustering using tslearn package even with joblib capabilities is painstaking slow. I m trying to cluster using dynamic time wrapping method. Can anyone suggest better method to cluster my data.
I have tried all the packages in python without any leads. Please let me know if any implementation of time-series clustering available with dtw metric which works in parallel.
 A: A good answer has already been given, but here's an alternative method. It is a very simple summary of a paper by Rob Hyndman

*

*Let each time series be $X_i = (X_{i,1}, X_{i,2}, \ldots )$. They do not need to be of equal length or be sampled at the same time points.

*Obtain summary statistics of each $X_i$; $\theta_i$ for each time series. Relatively simple models like bin smoothers, splines or low order polynomials might be effective.  You could also experiment with moments of $X_i$. You will need to fit the same type of model/calculate same summaries for each time series for this method to work. The linked paper gives many more details.

*Perform clustering on $\theta_i$ using e.g. $k$-means.

In my experience, I have founds this to be much faster than DTW. In a recent example, I clustered ~10s of thousands time series in ~15 minutes using a method based on this approach. The 15 minutes included model selection (number of bins in a bin smoother) as well as simultaneously choosing $k$ for $k$-means. Timing will depend on your machine and chosen language, but DTW could have taken a week or so for my example.
A: *

*Instead of DTW, use cDTW, with a constraint of about 5%. That will give a ~20 times speed up


*If the data is oversampled (as most data is) you can downsample it before using DTW. Since the time is quadratic in length, if you downsample by say 1 in 3, that would be about nine times faster.


*You can combine ideas '1' and '2' to get about 200 times faster...
PS, DTW is not a metric, it is a measure
https://www.cs.unm.edu/~mueen/DTW.pdf
