Skip to content

TimeSeriesKMeans with custom metric #474

Description

@trintingnant

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,

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions