dtw

Time series distance metric

冷暖自知 提交于 2019-12-04 21:58:33
问题 In order to clusterize a set of time series I'm looking for a smart distance metric. I've tried some well known metric but no one fits to my case. ex: Let's assume that my cluster algorithm extracts this three centroids [s1, s2, s3]: I want to put this new example [sx] in the most similar cluster: The most similar centroids is the second one, so I need to find a distance function d that gives me d(sx, s2) < d(sx, s1) and d(sx, s2) < d(sx, s3) edit Here the results with metrics [cosine,

Different results and performances with different libraries

可紊 提交于 2019-12-01 09:12:17
I'm comparing the libraries dtaidistance , fastdtw and cdtw for DTW computations. This is my code: from fastdtw import fastdtw from cdtw import pydtw import fastdtw import array from timeit import default_timer as timer from dtaidistance import dtw, dtw_visualisation as dtwvis s1 = mySampleSequences[0] # first sample sequence consisting of 3000 samples s2 = mySampleSequences[1] # second sample sequence consisting of 3000 samples start = timer() distance1 = dtw.distance(s1, s2) end = timer() start2 = timer() distance2 = dtw.distance_fast(array.array('d',s1),array.array('d',s2)) end2 = timer()

Calculating a distance matrix by dtw

纵饮孤独 提交于 2019-11-28 02:29:24
I have two matrices of normalized read counts for control and treatment in a time series day1 to day26. I want to calculate distance matrix by Dynamic Time Wrapping afterward use that for clustering but seems too complicated. I did so; who can help for more clarification please? Thanks a lot > head(control[,1:4]) MAST2 WWC2 PHYHIPL R3HDM2 Control_D1 6.591024 5.695156 3.388652 5.756384 Control_D1 8.043454 5.365221 6.859768 6.936970 Control_D3 7.731590 4.868267 6.919972 6.931073 Control_D4 8.129948 5.105528 6.627016 7.090268 Control_D5 7.690863 4.729501 6.824746 6.904610 Control_D6 8.101723 5

Calculating a distance matrix by dtw

◇◆丶佛笑我妖孽 提交于 2019-11-26 23:44:00
问题 I have two matrices of normalized read counts for control and treatment in a time series day1 to day26. I want to calculate distance matrix by Dynamic Time Wrapping afterward use that for clustering but seems too complicated. I did so; who can help for more clarification please? Thanks a lot > head(control[,1:4]) MAST2 WWC2 PHYHIPL R3HDM2 Control_D1 6.591024 5.695156 3.388652 5.756384 Control_D1 8.043454 5.365221 6.859768 6.936970 Control_D3 7.731590 4.868267 6.919972 6.931073 Control_D4 8