1

If I'm not using DTW as the distance metrics, both tslearn.clustering.TimeSeriesKMeans and sklearn.cluster.KMeans equivalent to each other?

If not can someone tell me what is the main difference between these 2 packages?

  • Check this [link](https://stackoverflow.com/questions/3503668/how-can-i-perform-k-means-clustering-on-time-series-data) – vb_rises Apr 30 '19 at 12:58

1 Answers1

6

The main difference is only that you can have "dtw" as the metric in tslearn Kmeans which is helpful in clustering time series data of different length while in sklearn it gives error if your time series data if of different length mainly because it consider each time stamp as a new feature and when your data is not in the matrix format it consider it as wrong format.

Interesting to know that tslearn itself uses sklearn in background.

But still, tslearn may have issue while clustering data of different "n_clusters" other than 2, for example, say 3. /it predicts only 2 labels sometimes. here I mentioned make 4 clusters but it gave only 2 labels

dyluns
  • 155
  • 9
Yash Gupta
  • 138
  • 1
  • 9