-
Notifications
You must be signed in to change notification settings - Fork 189
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
[ENH] Adds kdtw kernel support for kernelkmeans #2645
Conversation
Thank you for contributing to
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another great addition thanks!
Reference Issues/PRs
Fixes #1728
What does this implement/fix? Explain your changes.
Adds support for Kdtw Kernel for KernelKmeans Clustering as implemented in https://github.com/pfmarteau/KDTW/tree/master and also the tests for the same
Changes and Explaination:
In the
_fit
method ofTimeSeriesKernelKMeans
before initializing theTsLearnKernelKMeans
object we check ifself.kernel
is equal to "kdtw" if thats the case we pass a callable function toself.kernel
Apart from this we add 3 functions
_kdtw_lk
,kdtw
andfactory_kdtw_kernel
factory_kdtw_kernel
: This returns a callable kdtw kernel function that unflattens theinputs x and y which are univariate time series of dimension
(n_timepoints*n_channels,)
kdtw
: This is the kernel function for kdtw it needs the input x and y to be of dimension(n_timepoints, n_channels,)
Tests are also added
Does your contribution introduce a new dependency? If yes, which one?
Any other comments?
Tests need to be added, but implementation is complete
PR checklist
For all contributions
For new estimators and functions
__maintainer__
at the top of relevant files and want to be contacted regarding its maintenance. Unmaintained files may be removed. This is for the full file, and you should not add yourself if you are just making minor changes or do not want to help maintain its contents.For developers with write access