From 889aea6da99cc94d18337f258c5ed64cf5c495a5 Mon Sep 17 00:00:00 2001 From: hs-nazuna Date: Thu, 25 Jun 2020 18:48:26 +0900 Subject: [PATCH 1/2] add explanation of n_jobs in _validation.py --- sklearn/model_selection/_validation.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index a7e86793138e2..2fc61deb00524 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -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 ` for more details. @@ -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 ` for more details. @@ -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 ` for more details. @@ -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 ` for more details. @@ -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 ` for more details. @@ -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 ` for more details. From b99bd459dac23d1a88687fa7f9ae39913c4dc6e5 Mon Sep 17 00:00:00 2001 From: hs-nazuna Date: Thu, 25 Jun 2020 18:55:44 +0900 Subject: [PATCH 2/2] modify too long lines --- sklearn/model_selection/_validation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index 2fc61deb00524..6e4e155bc064c 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -705,8 +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 - Number of jobs to run in parallel. Training the estimator and predicting - are parallelized over the cross-validation splits. + 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 ` for more details. @@ -1480,8 +1480,8 @@ def validation_curve(estimator, X, y, *, param_name, param_range, groups=None, n_jobs : int, default=None 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. + 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 ` for more details.