Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MAINT Do not compute distances for uniform weighting for knn-based estimators' predictions #22280

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

Merged

Conversation

jjerphan
Copy link
Member

Reference Issues/PRs

Extracted from #22214 .

What does this implement/fix? Explain your changes.

For case of knn-based estimators' predictions, a weighting based on the distances can be used.
In the case of uniform weighting, the distances aren't used.

This PR proposes a small optimization removing the computations of distances in this case.

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ogrisel ogrisel merged commit fb082b2 into scikit-learn:main Jan 24, 2022
@ogrisel
Copy link
Member

ogrisel commented Jan 24, 2022

Thanks!

@ogrisel
Copy link
Member

ogrisel commented Jan 24, 2022

No need for a changelog entry for this small optim because we will already have an entry for the larger perf optimization of #22214 .

@jjerphan jjerphan deleted the uniform-weighting-knn-class-optim branch January 24, 2022 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants