2

I am trying out the different windowing options in dtw package detailed on this page: https://dynamictimewarping.github.io/py-api/html/api/dtw.dtw.html, hoping to see if I can reduce the time needed to run the dtw package.

When I entered

alignment = dtw(query_sample, ref_sample, keep_internals=True, window_type = "sakoechiba")

I got this error:

TypeError: sakoeChibaWindow() missing 1 required positional argument: 'window_size'

I then entered

alignment = dtw(query_sample, ref_sample, keep_internals=True, window_type = "sakoechiba", window_size = 5)

and got this error instead

TypeError: dtw() got an unexpected keyword argument 'window_size'

So where do I put the window_size argument? Appreciate your help, thank you.

ninichang
  • 21
  • 1

2 Answers2

1

You must specify window_args and it can be done in two ways:

alignment = dtw(query_sample, ref_sample, keep_internals=True, 
                window_type= "sakoechiba", window_args= {"window_size": 7})

or

alignment = dtw(query_sample, ref_sample, keep_internals=True, 
                window_args= {"window_type": "sakoechiba", "window_size": 7})
Brzoskwinia
  • 371
  • 2
  • 11
0

You can pass it as a dict within the "window_args" argument.