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
[MRG] Deprecate WMinkowskiDistance & make MinkowskiDistance accept weights #21873
[MRG] Deprecate WMinkowskiDistance & make MinkowskiDistance accept weights #21873
Conversation
…ecate-wminkowski-modify-minkowski-weights
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.
Thank you very much for the follow-up PR. This is really appreciated. Please find some suggestions/comments to address below:
Thank you so much for the detailed suggestions @ogrisel! I have incorporated the changes. |
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.
Thanks, the updated PR looks good to me!
Can you please run a quick interactive benchmark using ipython or jupyter and the %timeit
magic command to check that this does not cause a significant performance regression compared to main
when computing unweighted pairwise Minkowski distances between two random arrays in a 10d dimensional space?
The extra if has_w:
check is probably degrading the performance by up to 30% or so in very low dimensional space (e.g. 2d or 3d) but so be it.
Main branch's vs current branch's unweighted Minkowski -
|
Great, so no performance problems. Thanks for benchmarking. |
The sphinx warnings from https://165839-843222-gh.circle-artifacts.com/0/doc/_changed.html seems unrelated to this PR. Let me push a merge commit to check if they have been concurrently resolved in |
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.
Thank you for this contribution, @yarkhinephyo.
Here are a few comments.
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.
LGTM after formatting with black.
The errors on the CI here look unrelated to your PR. Can you re-trigger the CI by adding an empty commit, @yarkhinephyo? This can be done by:
Edit: I just did it to move forward. |
It indeed just was a random failure on the CI. |
…ights (scikit-learn#21873) Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Reference Issues/PRs
Resolves #21765
What does this implement/fix? Explain your changes.
_dist_metrics.WMinkowskiDistance
_dist_metrics.MinkowskiDistance
to accept optional weightsw
w
Any other comments?
Nil