I want to know Distance of KNN Search Using DTW(dynamic time warping)

5 ビュー (過去 30 日間)
JeongHeon Kim
JeongHeon Kim 2019 年 10 月 18 日
回答済み: Eamonn 2019 年 10 月 21 日
HI
as you see tilte, I want to get Distance form knnsearch using dtw function
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
X = [Gyrx(:,1:9)';zeros(300,601)]; % data X = [309X601]
Y = Gyrx(:,10)'; % data Y = [1X601]
tic
[~, Dist] = knnsearch(X,Y,'Distance',@distfun_dtw);
toc
function Dis = distfun_dtw(Y,X)
Dis = [];
for i =1:length(X(:,1))
D=dtw(X(i,:),Y);
Dis = [D2;D];
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This is my code. I want to know minmum distance between Xdata and Ydata using dtw, Not euclidean distance
And also I hope this code should be fast because I try to apply knnsearch in real time classification
Please answer the question.
Thank you

回答 (2 件)

Eamonn
Eamonn 2019 年 10 月 21 日
Sure, but matlab has DWT built in

Eamonn
Eamonn 2019 年 10 月 18 日
Hello., Use the UCR suite, it is at least 10,000 times faster than real time (for say 100Hz data)
Also, read this tutorial. https://www.cs.unm.edu/~mueen/DTW.pdf
  1 件のコメント
JeongHeon Kim
JeongHeon Kim 2019 年 10 月 21 日
Thank you.
But your link with code and tutorial only has C code.
Can I get the Matlab code instead of C code?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by