Skip to content

DOC: updated documentation for n_jobs in _graph.py #DataUmbrella #17513

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions sklearn/neighbors/_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def kneighbors_graph(X, n_neighbors, *, mode='connectivity',
for mode='distance'.

n_jobs : int, default=None
The number of parallel jobs to run for neighbors search.
The number of jobs to run in parallel; the k-nearest neighbor
computations are performed parallel to each other.
``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
``-1`` means using all processors. See :term:`Glossary <n_jobs>`
for more details.
Expand Down Expand Up @@ -159,7 +160,8 @@ def radius_neighbors_graph(X, radius, *, mode='connectivity',
for mode='distance'.

n_jobs : int, default=None
The number of parallel jobs to run for neighbors search.
The number of jobs to run in parallel; the k-nearest neighbor
computations are performed parallel to each other.
Comment on lines +163 to +164
Copy link
Member

@thomasjpfan thomasjpfan Jun 7, 2020

Choose a reason for hiding this comment

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

Thank you for the PR!

I think the original is clear enough about what n_jobs is used for.

Aside: radius_neighbors_graph finds the neighbors in a given radius.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback! We can leave it as it is then. Also thanks for the clarification.

``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
``-1`` means using all processors. See :term:`Glossary <n_jobs>`
for more details.
Expand Down Expand Up @@ -272,7 +274,8 @@ class KNeighborsTransformer(KNeighborsMixin, UnsupervisedMixin,
Additional keyword arguments for the metric function.

n_jobs : int, default=1
The number of parallel jobs to run for neighbors search.
The number of jobs to run in parallel; the k-nearest neighbor
computations are performed parallel to each other.
If ``-1``, then the number of jobs is set to the number of CPU cores.

Examples
Expand Down Expand Up @@ -414,7 +417,8 @@ class RadiusNeighborsTransformer(RadiusNeighborsMixin, UnsupervisedMixin,
Additional keyword arguments for the metric function.

n_jobs : int, default=1
The number of parallel jobs to run for neighbors search.
The number of jobs to run in parallel; the k-nearest neighbor
computations are performed parallel to each other.
If ``-1``, then the number of jobs is set to the number of CPU cores.

Examples
Expand Down