Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimeSeriesKMeans with custom metric #474

Open
trintingnant opened this issue Aug 2, 2023 · 1 comment
Open

TimeSeriesKMeans with custom metric #474

trintingnant opened this issue Aug 2, 2023 · 1 comment

Comments

@trintingnant
Copy link

Hi,

I would like to do kDBA, but using a custom metric for computing the DTW alignments (not available in either scikit or scipy).

Now, dtw_variants has the dtw_path_from_metric function, so there it is always possible to compute dtw alignments for any pair of timeseries, passing the metric either as a functional, or by passing a pre-computed distance matrix (which for my purposes is not super-feasible).

Now, the problem is that the dba module only ever uses dtw_path, and so is always, at least implicitly, using euclidean distance. Is there a straigtforward way of passing custom metrics to TimeSeriesKMeans such that it computes the dtw alignments using a custom metric? It probably isn't too hard to change all calls to dtw_path to dtw_path_from_metric, conditional on a metric being provided. Just checking if there is an easier way.

Thanks,

@trintingnant
Copy link
Author

[edit] got a working version of this now. If anyone is interested. Would need more testing though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant