lukauskas / dtwco

dtwco: constrained Dynamic Time Warping implementation in python
Other
43 stars 9 forks source link

Active development? #1

Closed chrisdembia closed 7 years ago

chrisdembia commented 10 years ago

I plan to use mlpy's DTW, but to do KNN classification. How complete are your improvements of mlpy's DTW?

Also, it seems that mlpy is not set up by default to use DTW as the distance metric in KNN. Do you have any further insight into how to do so?

lukauskas commented 10 years ago

Hi,

the improvements to DTW are complete, yet never integrated to the mlpy's core. I do not actively maintain this branch any more, but you're welcome to fork it.

Regarding KNN, you probably would want to somehow pass pre-computed distance matrix to KNN algorithm, rather than computing the distances on the fly. Such matrix can be obtained using pdist in scipy or equivalent.

EDIT: Removed the note about clustering as you're using KNN, not k-means, I need coffee.

chrisdembia commented 10 years ago

Thanks for your response!

I'm a little confused about the use of a precomputed distance matrix. When I test a point, it needs to evaluate those distances given that test point. Since the algorithm doesn't know what points I'll be testing, what can be precomputed?

lukauskas commented 10 years ago

Yeah, you're right. I was thinking of k means again when I wrote that. You cannot do anything more sophisticated than rewriting part of the algorithm to use dtw then. Maybe with an ig statement to select euclid vs dtw. Though I suggest just implementing it in python and then going to c code if it is too slow.

There are also a couple of papers published about efficient dtw indexing and approximations that work for large database searches On 13 Nov 2013 19:07, "Christopher Dembia" notifications@github.com wrote:

Thanks for your response!

I'm a little confused about the use of a precomputed distance matrix. When I test a point, it needs to evaluate those distances given that test point. Since the algorithm doesn't know what points I'll be testing, what can be precomputed?

— Reply to this email directly or view it on GitHubhttps://github.com/sauliusl/mlpy/issues/1#issuecomment-28423667 .

marweck commented 9 years ago

Hi, is mlpy development still inactive?

It's a pitty since the 3.5.0 DTW implementation is so much faster than my pure python one.

I really miss the constraint='sakoe-chiba' parameter that seems to be implemented in 3.5.1.

Do you plan to release that version? If not, do you suggest another python package with a good implementation of DTW?

Thanks.

lukauskas commented 9 years ago

Hey.

This is an unofficial fork of MLPY. I have stopped actively working on it for now, but you are welcome to adopt it and maybe get it merged to the official one (which does not seem to be updated either!).

Otherwise feel free to use my updates for whatever (according to the license).

The implementation in my fork should be complete and fully functioning.

lukauskas commented 7 years ago

Closing this down as I decided to split this package off from the mlpy base. @marweck , essentially as per your suggestion.

marweck commented 7 years ago

Hi @lukauskas, good to hear that.

I have finished my project on time series pattern matching. I ended up using SAX created by Eamonn Keogh and Jessica Lin (http://www.cs.ucr.edu/~eamonn/SAX.htm).

Thanks anyway.

Wish you success.