How to use the dtaidistance.dtw_visualisation.plot_warpingpaths function in dtaidistance

To help you get started, we’ve selected a few dtaidistance examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wannesm / dtaidistance / tests / test_dtw_weighted.py View on Github external
])
    w = np.array([[np.inf, np.inf, 0.,  0., 0.,  0.,   np.inf, np.inf],
                  [np.inf, np.inf, 1.1, 1., 0.,  0.,   np.inf, np.inf],
                  [np.inf, np.inf, 1.1, 1., 0.,  0.,   np.inf, np.inf],
                  [np.inf, np.inf, 0.,  0., 2.,  2.2,  np.inf, np.inf],
                  [np.inf, np.inf, 0.,  0., 1.,  1.1,  np.inf, np.inf],
                  [np.inf, np.inf, 0.,  0., 0.,  0.,   np.inf, np.inf],
                  [np.inf, np.inf, 0.,  0., 1.3, 1.43, np.inf, np.inf],
                  [np.inf, np.inf, 0.,  0., 0.,  0.,   np.inf, np.inf],
                  [np.inf, np.inf, 0.,  0., 0.,  0.,   np.inf, np.inf]])

    d, paths = dtww.warping_paths(s[0], s[1], w, window=0)
    path = dtw.best_path(paths)
    if directory:
        wp_fn = directory / "warping_paths.png"
        dtwvis.plot_warpingpaths(s[0], s[1], paths, path, filename=wp_fn)