how to perform clustering using dtw and some clustering method like kmeans

I have a timeseries(temperature of a sensor)and I want to apply an unsupervised clustering that. I've already done that using sklearn library and Kmeans. but the problem is that I don't know how to add DTW as a metric. I need to compare timeseries using DTW and I have no idea how to do that.

Also as I saw in this link Kmeans can not perform very well on some kind of data, some methods like OPTICS and DBSCAN may be perform better on different type of data but the problem is that I tried them and they don't have predict function like kmeans. is there a better method for my problem?

Topic dynamic-time-warping scikit-learn classification python

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.