jzumer / pytwed

Python wrapper for Time Warped Edit Distance
MIT License
17 stars 4 forks source link

Is it possible to tweak this to handle string/object data? #11

Open laurenleesc opened 3 years ago

laurenleesc commented 3 years ago

It would be useful for me if this could have categorical time series data. Would it be possible to add this functionality? Would it be something like changing line 11 in slow_twed.py to also be the edit distance, similar to the nltk implementation? Thanks!

marcus-voss commented 3 years ago

Hey @laurenleesc, sorry, I missed that.

TWED has been introduced as an edit distance for real numbers (as edit distances on strings already exist) and mixes it with warping invariance properties of DTW. So have aimed for providing an implementation based on the original paper (actually the python code has been copied from Marteau's repository and we changed the license with his permission. So I guess generalizing it back to string/object data would probably need some conceptual thinking about it.

What would be some properties that for you make this more useful then existing string-based Edit distances?

laurenleesc commented 3 years ago

Hi @marcus-voss, thank you for your response!

I have time-stamped medical billing codes. I would like to be able to separate the effect of actual time elapsing between treatments from any possible effects of the order of the treatment (sequence of codes). Does that make sense?

Thank you in advance!