Thread: [Java-ML-support] JavaML and Dynamic Time Warping (DTW) confusion
Status: Beta
Brought to you by:
thomasabeel
From: <je...@hi...> - 2013-03-01 23:24:20
|
Hi, I need an implementation of calculating the DTW (dynamic time warping) distance of timeseries patterns in order to compare and classify them. At this time, the patterns are double[] arrays which is no problem since I can make them to timeseries objects. In JavaML I found two implementations of DTW now I'm quite confused. The two variations in JavaML package are: -- DTW.getWarpDistBetween(TimeSeries tsI, TimeSeries tsJ); -- and -- DTWSimilarity dtw = new DTWSimilarity(); dtw.measure(Instance i1, Instance i2); -- I looked into source code and the two functions getWarpDistBetween() and measure() look quite different. In measure() there is a hint that it maps the dtw distance with f(x)= 1 - (x / (1 + x)) to a similarity measure. But when I apply this formula to the output of getWarpDistBetween() it does not provide the same solution. Could you tell me, whats the difference of these two functions apart from comversation to a similarity measure in measure()? And which approach should I choose, if I want a classical dtw distance for two timeseries? Thank you in advance! Best regards, Jens |
From: Thomas A. <ta...@br...> - 2013-04-04 13:54:35
|
Hi Jens, Sorry for the delay in my response. If you want the classical dtw distance, I'd guess DTW.getWarpDistBetween is the one you want to use. Using that DTW is at your own risk. I didn't implement the DTW metrics myself and I am not yet 100% convinced the implementation is correct. If you could provide more insights, I'd be grateful. If you know about better implementations I'd be happy to include those, but it seems this is one of the very few available. cheers, Thomas On 3/1/2013 6:04 PM, je...@hi... wrote: > Hi, > > I need an implementation of calculating the DTW (dynamic time warping) > distance of timeseries patterns in order to compare and classify them. > At this time, the patterns are double[] arrays which is no problem since > I can make them to timeseries objects. > > In JavaML I found two implementations of DTW now I'm quite confused. The > two variations in JavaML package are: > > -- > DTW.getWarpDistBetween(TimeSeries tsI, TimeSeries tsJ); > -- > > and > > -- > DTWSimilarity dtw = new DTWSimilarity(); > dtw.measure(Instance i1, Instance i2); > -- > > I looked into source code and the two functions getWarpDistBetween() and > measure() look quite different. In measure() there is a hint that it > maps the dtw distance with f(x)= 1 - (x / (1 + x)) to a similarity > measure. But when I apply this formula to the output of > getWarpDistBetween() it does not provide the same solution. > > Could you tell me, whats the difference of these two functions apart > from comversation to a similarity measure in measure()? And which > approach should I choose, if I want a classical dtw distance for two > timeseries? > > Thank you in advance! > > Best regards, > Jens > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Java-ml-support mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-ml-support |
From: <je...@hi...> - 2013-04-04 14:01:36
|
Hi Thomas, thank you for your email. I've testet another java library called fastdtw (http://code.google.com/p/fastdtw/) and on some non-representative test examples it brought me the same results. Though I used the --- DTW.getWarpDistBetween(TimeSeries tsI, TimeSeries tsJ); --- for my following work. Best regards, Jens Am 04.04.2013 15:54, schrieb Thomas Abeel: > Hi Jens, > > Sorry for the delay in my response. > > If you want the classical dtw distance, I'd guess > > DTW.getWarpDistBetween is the one you want to use. > > Using that DTW is at your own risk. I didn't implement the DTW metrics > myself and I am not yet 100% convinced the implementation is correct. If > you could provide more insights, I'd be grateful. If you know about > better implementations I'd be happy to include those, but it seems this > is one of the very few available. > > cheers, > Thomas > > On 3/1/2013 6:04 PM, je...@hi... wrote: >> Hi, >> >> I need an implementation of calculating the DTW (dynamic time warping) >> distance of timeseries patterns in order to compare and classify them. >> At this time, the patterns are double[] arrays which is no problem since >> I can make them to timeseries objects. >> >> In JavaML I found two implementations of DTW now I'm quite confused. The >> two variations in JavaML package are: >> >> -- >> DTW.getWarpDistBetween(TimeSeries tsI, TimeSeries tsJ); >> -- >> >> and >> >> -- >> DTWSimilarity dtw = new DTWSimilarity(); >> dtw.measure(Instance i1, Instance i2); >> -- >> >> I looked into source code and the two functions getWarpDistBetween() and >> measure() look quite different. In measure() there is a hint that it >> maps the dtw distance with f(x)= 1 - (x / (1 + x)) to a similarity >> measure. But when I apply this formula to the output of >> getWarpDistBetween() it does not provide the same solution. >> >> Could you tell me, whats the difference of these two functions apart >> from comversation to a similarity measure in measure()? And which >> approach should I choose, if I want a classical dtw distance for two >> timeseries? >> >> Thank you in advance! >> >> Best regards, >> Jens >> >> ------------------------------------------------------------------------------ >> >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_feb >> _______________________________________________ >> Java-ml-support mailing list >> Jav...@li... >> https://lists.sourceforge.net/lists/listinfo/java-ml-support > |