简体   繁体   中英

tslearn.clustering.TimeSeriesKMeans vs sklearn.cluster.KMeans

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?

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 have may 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM