-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
MAINT Improve Nearest Neighbor documentation + code consistency #19793
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
Conversation
1) Fix typos 2) Use self.metric == "precomputed" instead of combination of both self.effective_metric and self.metric 3) Use n_samples_fit instead of a combination of both n_indexed and n_samples_fit 4) Other minor 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.
I think most of the code changes are an improvement.
For the documentation changes, we do use n_indexed
in other places, such as check_pairwise_arrays
. To move forward, I suggest reverting the docstring changes relating to n_indexed
and opening another PR for n_indexed
.
In general, keeping PRs smaller makes them easier to merge.
@thomasjpfan Per your instructions, I've reverted the relevant 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.
I think staying consistent with the rest of the library using self.metric == 'precomputed'
is net win.
LGTM
Thanks @chrisyeh96 ! |
Fix typos
Use
self.metric == "precomputed"
instead of combination of bothself.effective_metric
andself.metric
. (self.effective_metric
is only different fromself.metric
only for minkowski metric. For"precomputed"
metric,self.effective_metric
andself.metric
are equivalent.)Usen_samples_fit
instead of a combination of bothn_indexed
andn_samples_fit
Other minor changes