pollen-robotics / dtw

DTW (Dynamic Time Warping) python module
GNU General Public License v3.0
1.16k stars 233 forks source link

A question, not an issue (sorry for posting here) #21

Closed fifthguy closed 6 years ago

fifthguy commented 6 years ago

Hi!

Thanks for the library, I find it very useful.

I have one question though: How exactly is the cost calculated herein? As sum of the move values, that resulted in the minimum distance?

Thank you again!

Best, T

pierre-rouanet commented 6 years ago

Hi!

Thanks for using the library :)

How exactly is the cost calculated herein? As sum of the move values, that resulted in the minimum distance?

Yep pretty much! (https://github.com/pierre-rouanet/dtw/blob/master/dtw.py#L27)

In this implementation, there is no additional cost for adding or removing elements. It's directly the element by element comparison of the two series. There is also some weighting over the whole path (see https://github.com/pierre-rouanet/dtw/issues/2 for more details on this).

Those choices are kind of arbitrary, you can find many different implementations of DTW depending on the data you want to compare.

I don't really work on dtw anymore but I'll gladly integrate other implementation!

pierre-rouanet commented 6 years ago

Does that answer your question?

fifthguy commented 6 years ago

Hi

Sorry for not responding and closing the issue immediately, then I simply forgot. Yes it helped, it clarified what I needed to know. Thank you very much.

Best, T