lazavgeridis / Dynamic-Time-Warping

Time-series classification using dtw
1 stars 1 forks source link
c dynamic-programming dynamic-time-warping time-series-classification

Time-Series Classification with Dtw

Assuming that d(ai,bj) = (ai-bj)^2 and that min{x,y,z} is the minimum of x,y and z the dtw formula is the following:

Screenshot

Description

Execution

$ make dtwdp

The dtwdp is the recommended executable to be generated. Some sample executions are presented below.

$ cat train_FaceFour.txt test_FaceFour.txt | ./dtwdp
cat train_FaceFour.txt test_FaceFour.txt | ./dtwdp 0
cat train_FaceFour.txt test_FaceFour.txt | ./dtwdp 7

Screenshot Screenshot Notice how much the cpu time drops when a small constraint argument is given. Some more examples:

cat train_ECG5000.txt test_ECG5000.txt | ./dtwdp > /dev/null
cat train_ECG5000.txt test_ECG5000.txt | ./dtwdp 0 > /dev/null
cat train_ECG5000.txt test_ECG5000.txt | ./dtwdp 45 > /dev/null

Screenshot