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

[ENH] Mahalanobis distance #1351

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

[ENH] Mahalanobis distance #1351

wants to merge 3 commits into from

Conversation

krstopro
Copy link

Reference Issues/PRs

Fixes #1225.

What does this implement/fix? Explain your changes.

Implements Mahalanobis distance.

Any other comments?

Following "Learning a Mahalanobis Distance based Dynamic Time Warping Measure for Multivariate Time Series Classification" paper the square root is removed. Therefore, the distance implemented is actually the Mahalanobis distance squared. I am not sure about this.

@aeon-actions-bot aeon-actions-bot bot added distances Distances package enhancement New feature, improvement request or other non-bug code enhancement labels Mar 27, 2024
@aeon-actions-bot
Copy link
Contributor

Thank you for contributing to aeon

I have added the following labels to this PR based on the title: [ $\color{#FEF1BE}{\textsf{enhancement}}$ ].
I have added the following labels to this PR based on the changes made: [ $\color{#5209C9}{\textsf{distances}}$ ]. Feel free to change these if they do not properly represent the PR.

The Checks tab will show the status of our automated tests. You can click on individual test runs in the tab or "Details" in the panel below to see more information if there is a failure.

If our pre-commit code quality check fails, any trivial fixes will automatically be pushed to your PR unless it is a draft.

Don't hesitate to ask questions on the aeon Slack channel if you have any.

@chrisholder
Copy link
Contributor

chrisholder commented Mar 27, 2024

Hi @krstopro thanks so much for the PR! Great to have a new distance! If you're struggling with anything in regards to the tests or CICD stuff feel free to shoot me a message on slack so we can get this in quicker.

@aadya940
Copy link
Contributor

Hey @krstopro , This looks really good. Also from what I remember, including mahalanobis_distance into aeon was still under discussion so I would recommend putting this on the slack channel.

@krstopro
Copy link
Author

Hey @krstopro , This looks really good. Also from what I remember, including mahalanobis_distance into aeon was still under discussion so I would recommend putting this on the slack channel.

Oh, I see. I saw that the issue is open and decided to implement it.

@aadya940
Copy link
Contributor

@krstopro Also, you rightly said that they've implemented the "squared" mahalanobis distance. In aeon, I think we should discuss it once if we want to implement the squared or a more general regular mahalanobis distance.

@krstopro
Copy link
Author

@krstopro Also, you rightly said that they've implemented the "squared" mahalanobis distance. In aeon, I think we should discuss it once if we want to implement the squared or a more general regular mahalanobis distance.

I am not exactly sure on which Slack channel should I write. I've dropped you a message there.

@MatthewMiddlehurst
Copy link
Member

@chrisholder @aadya940 @krstopro Just checking in, everything good with this PR? Feel free to ask questions if you need some help.

@krstopro
Copy link
Author

@chrisholder @aadya940 @krstopro Just checking in, everything good with this PR? Feel free to ask questions if you need some help.

@MatthewMiddlehurst Yes, sorry. I was just busy and didn't write on Slack about it. Is it fine that I do it now?

@MatthewMiddlehurst
Copy link
Member

Yep, feel free to work at your own pace. I would ask in the #distances channel, but other channels you think are relevant are also fine.

@aadya940
Copy link
Contributor

@krstopro @MatthewMiddlehurst Mahalanobis is primarily significant in outlier detection, we could mention it somewhere in the docstring once the PR is done?

@MatthewMiddlehurst
Copy link
Member

@chrisholder discussed fixing some of the testing issues on Slack. Just an FYI for others, not a push to do so asap 🙂.

@chrisholder
Copy link
Contributor

chrisholder commented Apr 19, 2024

Just an update @krstopro and I spoke on slack and he is implementing an update to make the distance symmetric (it currently isnt) and then I will finalise the tests for the distance.

@MatthewMiddlehurst
Copy link
Member

Hi, any progress on the above @chrisholder @krstopro?

@krstopro
Copy link
Author

@MatthewMiddlehurst Not yet, sorry. I hope to push by the end of the week. Apologies for the delay.

@MatthewMiddlehurst
Copy link
Member

no rush if you are busy, just checking in 🙂

@MatthewMiddlehurst
Copy link
Member

This has got a bit stale, merged main into it.

@MatthewMiddlehurst
Copy link
Member

There have been a few distance updates recently, I think this would be outdated now? @chrisholder

@chrisholder
Copy link
Contributor

@krstopro we can now support the distances not returning the same value with different x, y orders (i.e. y, x). This means we can get this in. If you're still around reach out to me on the slack and we can work through this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distances Distances package enhancement New feature, improvement request or other non-bug code enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH] Implement Mahalanobis Distance
4 participants