Skip to content

DOC add more details for n_jobs in MeanShift docstring #25083

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
merged 10 commits into from
Dec 6, 2022
22 changes: 18 additions & 4 deletions sklearn/cluster/_mean_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,15 @@ def mean_shift(
operation terminates (for that seed point), if has not converged yet.

n_jobs : int, default=None
The number of jobs to use for the computation. This works by computing
each of the n_init runs in parallel.
The number of jobs to use for the computation. The following tasks benefit
from the parallelization:

- The search of nearest neighbors for bandwidth estimation and label
assignments. See the details in the docstring of the
``NearestNeighbors`` class.
- Hill-climbing optimization for all seeds.

See :term:`Glossary <n_jobs>` for more details.

``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
``-1`` means using all processors. See :term:`Glossary <n_jobs>`
Expand Down Expand Up @@ -312,8 +319,15 @@ class MeanShift(ClusterMixin, BaseEstimator):
If false, then orphans are given cluster label -1.

n_jobs : int, default=None
The number of jobs to use for the computation. This works by computing
each of the n_init runs in parallel.
The number of jobs to use for the computation. The following tasks benefit
from the parallelization:

- The search of nearest neighbors for bandwidth estimation and label
assignments. See the details in the docstring of the
``NearestNeighbors`` class.
- Hill-climbing optimization for all seeds.

See :term:`Glossary <n_jobs>` for more details.

``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
``-1`` means using all processors. See :term:`Glossary <n_jobs>`
Expand Down