Repository navigation
DOC Standardize return descriptions across paired distance functions - #34352
Conversation
|
Thank you for opening your first pull request to scikit-learn! 🎉 To help get your contribution reviewed, please make sure that:
|
|
Hey @virchan! I saw you had to close PR #34349 earlier today because an automated bot tried to blindly fix my issue (#34315). I was originally holding off on claiming it until the Needs Triage label was officially removed, but to prevent any more AI-spam tools from scraping it and wasting reviewers' time, I went ahead and pushed this manually. Let me know if this looks good from your end |
|
gentle ping to the maintainers, the single failed |
|
@AnneBeyer hi, i have made the changes as you requested please let me know if that’d be all or if you want me to change anything. Thank you for looking into this :) |
AnneBeyer
left a comment
There was a problem hiding this comment.
Thank you, @shipitdev! One small nit, otherwise LGTM!
Could you update the title to reflect the new scope as well? (This will become the commit message once this get's merged.)
oh yes! For sure. I'll update the title to something the covers the scope here |
|
Thanks so much for the review, @AnneBeyer! Sorry for the delay in applying these, they didn't show up in my GitHub app initially. All fixed now. I really appreciate your time! |
e7ebaa5 to
ad4578a
Compare
ad4578a to
53c53c5
Compare
|
I apologize for the untidy history and multiple updates over the last few minutes. I was attempting to squash my commits but encountered some rebase issues, so I decided to leave the two commits intact rather than risk losing the changes. Thank you again for the review and your patience!" |
|
@AnneBeyer gentle ping, i'm happy to make any changes. Please let me know if this looks good from your end. |
virchan
left a comment
There was a problem hiding this comment.
Thank you for the PR, @shipitdev. I have a few comments.
| def paired_euclidean_distances(X, Y): | ||
| """Compute the paired euclidean distances between X and Y. | ||
|
|
||
| Distances are calculated between (X[0], Y[0]), (X[1], Y[1]), ..., etc. |
There was a problem hiding this comment.
I am fine with this change, as well as its counter-parts in paired_manhattan_distances and paired_cosine_distances. (I.e., #34352 (review).)
The other proposed changes also make sense, but the improvement is too minor to justify merging. Therefore, I suggest reverting them.
There was a problem hiding this comment.
sure, i'll go and revert it back.
Reference Issues/PRs
Fixes #34315
What does this implement/fix? Explain your changes.
This PR fixes an off-by-one indexing error in the docstring for
paired_manhattan_distanceswithinsklearn/metrics/pairwise.py.The previous docstring stated that distances are calculated up to
(X[n_samples], Y[n_samples]). Since Python uses 0-based indexing, attempting to access then_samplesindex raises anIndexErrorin practice. This PR corrects the documentation to accurately reference the final elements as(X[n_samples - 1], Y[n_samples - 1]).AI usage disclosure
I used AI assistance for:
Any other comments?
I've ensured this is fully human-reviewed and conforms to the guidelines. Let me know if anything else is needed!