Skip to content

DOC add explanation of n_jobs in sklearn/model_selection/_validation.py #17717

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 2 commits into from
Jun 25, 2020
Merged
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
19 changes: 13 additions & 6 deletions sklearn/model_selection/_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def cross_validate(estimator, X, y=None, *, groups=None, scoring=None, cv=None,
``cv`` default value if None changed from 3-fold to 5-fold.

n_jobs : int, default=None
The number of CPUs to use to do the computation.
Number of jobs to run in parallel. Training the estimator and computing
the score are parallelized over the cross-validation splits.
``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 @@ -328,7 +329,8 @@ def cross_val_score(estimator, X, y=None, *, groups=None, scoring=None,
``cv`` default value if None changed from 3-fold to 5-fold.

n_jobs : int, default=None
The number of CPUs to use to do the computation.
Number of jobs to run in parallel. Training the estimator and computing
the score are parallelized over the cross-validation splits.
``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 @@ -703,7 +705,8 @@ def cross_val_predict(estimator, X, y=None, *, groups=None, cv=None,
``cv`` default value if None changed from 3-fold to 5-fold.

n_jobs : int, default=None
The number of CPUs to use to do the computation.
Number of jobs to run in parallel. Training the estimator and
predicting are parallelized over the cross-validation splits.
``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 @@ -1041,7 +1044,8 @@ def permutation_test_score(estimator, X, y, *, groups=None, cv=None,
Number of times to permute ``y``.

n_jobs : int, default=None
The number of CPUs to use to do the computation.
Number of jobs to run in parallel. Training the estimator and computing
the cross-validated score are parallelized over the permutations.
``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 @@ -1199,7 +1203,8 @@ def learning_curve(estimator, X, y, *, groups=None,
used to speed up fitting for different training set sizes.

n_jobs : int, default=None
Number of jobs to run in parallel.
Number of jobs to run in parallel. Training the estimator and computing
the score are parallelized over the different training and test sets.
``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 @@ -1474,7 +1479,9 @@ def validation_curve(estimator, X, y, *, param_name, param_range, groups=None,
``scorer(estimator, X, y)``.

n_jobs : int, default=None
Number of jobs to run in parallel.
Number of jobs to run in parallel. Training the estimator and computing
the score are parallelized over the combinations of each parameter
value and each cross-validation split.
``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