Skip to content

DOC Improve n_jobs docstrings for neighbors estimators#33503

Closed
floattheboat wants to merge 1 commit intoscikit-learn:mainfrom
floattheboat:improve-n-jobs-docs-neighbors
Closed

DOC Improve n_jobs docstrings for neighbors estimators#33503
floattheboat wants to merge 1 commit intoscikit-learn:mainfrom
floattheboat:improve-n-jobs-docs-neighbors

Conversation

@floattheboat
Copy link
Copy Markdown

Summary

Updates n_jobs docstrings for all 8 neighbors estimators, explaining that query samples are split across workers for parallel neighbor search, and listing which methods are affected:

  • KNeighborsClassifier: predict, predict_proba, kneighbors, kneighbors_graph (not fit)
  • KNeighborsRegressor: predict, kneighbors, kneighbors_graph (not fit)
  • KNeighborsTransformer: transform, fit_transform
  • RadiusNeighborsClassifier: predict, predict_proba, radius_neighbors, radius_neighbors_graph (not fit)
  • RadiusNeighborsRegressor: predict, radius_neighbors, radius_neighbors_graph (not fit)
  • RadiusNeighborsTransformer: transform, fit_transform
  • NearestNeighbors: all four query methods (not fit)
  • LocalOutlierFactor: notably does affect fit (computes neighbor distances for local reachability density), plus score_samples and predict when novelty=True

Also normalizes the Glossary reference for KNeighborsTransformer and RadiusNeighborsTransformer, which previously had a non-standard format.

Contributes to #14228.

Test plan

  • Verify rendered docstrings render correctly
  • Confirm no test regressions in sklearn/neighbors/tests/

🤖 Generated with Claude Code

…14228)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@virchan virchan left a comment

Choose a reason for hiding this comment

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

@virchan virchan closed this Mar 26, 2026
@virchan virchan added spam spam PR and issues and removed Documentation module:neighbors labels Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spam spam PR and issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants