From 60980cd960fb3d4026c4017bda68085ba4915d4f Mon Sep 17 00:00:00 2001 From: Hanmin Qin Date: Tue, 14 Aug 2018 20:34:10 +0800 Subject: [PATCH 1/9] cluster module --- sklearn/cluster/bicluster.py | 10 ++++++++-- sklearn/cluster/dbscan_.py | 10 ++++++++-- sklearn/cluster/k_means_.py | 10 ++++++++-- sklearn/cluster/mean_shift_.py | 15 ++++++++++++--- sklearn/cluster/optics_.py | 10 ++++++++-- sklearn/cluster/spectral.py | 5 ++++- 6 files changed, 48 insertions(+), 12 deletions(-) diff --git a/sklearn/cluster/bicluster.py b/sklearn/cluster/bicluster.py index 7425e17fcd8a5..54e83a51dd6f4 100644 --- a/sklearn/cluster/bicluster.py +++ b/sklearn/cluster/bicluster.py @@ -228,15 +228,18 @@ class SpectralCoclustering(BaseSpectral): chosen and the algorithm runs once. Otherwise, the algorithm is run for each initialization and the best solution chosen. - n_jobs : int, optional, default: 1 + n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. This works by breaking down the pairwise matrix into n_jobs even slices and computing them in parallel. + If ``None``, then the number of jobs is set to 1 unless current joblib + backend context specifies otherwise. If -1 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one are used. + See :term:`Glossary `. random_state : int, RandomState instance or None (default) Used for randomizing the singular value decomposition and the k-means @@ -375,15 +378,18 @@ class SpectralBiclustering(BaseSpectral): chosen and the algorithm runs once. Otherwise, the algorithm is run for each initialization and the best solution chosen. - n_jobs : int, optional, default: 1 + n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. This works by breaking down the pairwise matrix into n_jobs even slices and computing them in parallel. + If ``None``, then the number of jobs is set to 1 unless current joblib + backend context specifies otherwise. If -1 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one are used. + See :term:`Glossary `. random_state : int, RandomState instance or None (default) Used for randomizing the singular value decomposition and the k-means diff --git a/sklearn/cluster/dbscan_.py b/sklearn/cluster/dbscan_.py index 990bfcc0d30f4..ef2fc93a2b6ce 100644 --- a/sklearn/cluster/dbscan_.py +++ b/sklearn/cluster/dbscan_.py @@ -76,9 +76,12 @@ def dbscan(X, eps=0.5, min_samples=5, metric='minkowski', metric_params=None, weight may inhibit its eps-neighbor from being core. Note that weights are absolute, and default to 1. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. + If ``None``, then the number of jobs is set to 1 unless current joblib + backend context specifies otherwise. If ``-1``, then the number of jobs is set to the number of CPU cores. + See :term:`Glossary `. Returns ------- @@ -229,9 +232,12 @@ class DBSCAN(BaseEstimator, ClusterMixin): The power of the Minkowski metric to be used to calculate distance between points. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run. + If ``None``, then the number of jobs is set to 1 unless current joblib + backend context specifies otherwise. If ``-1``, then the number of jobs is set to the number of CPU cores. + See :term:`Glossary `. Attributes ---------- diff --git a/sklearn/cluster/k_means_.py b/sklearn/cluster/k_means_.py index 444d8fca29f7b..d542a1c1be550 100644 --- a/sklearn/cluster/k_means_.py +++ b/sklearn/cluster/k_means_.py @@ -261,14 +261,17 @@ def k_means(X, n_clusters, sample_weight=None, init='k-means++', the data mean, in this case it will also not ensure that data is C-contiguous which may cause a significant slowdown. - n_jobs : int + n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. + If ``None``, then the number of jobs is set to 1 unless current joblib + backend context specifies otherwise. If -1 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one are used. + See :term:`Glossary `. algorithm : "auto", "full" or "elkan", default="auto" K-means algorithm to use. The classical EM-style algorithm is "full". @@ -834,14 +837,17 @@ class KMeans(BaseEstimator, ClusterMixin, TransformerMixin): the data mean, in this case it will also not ensure that data is C-contiguous which may cause a significant slowdown. - n_jobs : int + n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. + If ``None``, then the number of jobs is set to 1 unless current joblib + backend context specifies otherwise. If -1 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one are used. + See :term:`Glossary `. algorithm : "auto", "full" or "elkan", default="auto" K-means algorithm to use. The classical EM-style algorithm is "full". diff --git a/sklearn/cluster/mean_shift_.py b/sklearn/cluster/mean_shift_.py index 04d94ee41910c..1a9a9db9dfa51 100644 --- a/sklearn/cluster/mean_shift_.py +++ b/sklearn/cluster/mean_shift_.py @@ -53,9 +53,12 @@ def estimate_bandwidth(X, quantile=0.3, n_samples=None, random_state=0, deterministic. See :term:`Glossary `. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. + If ``None``, then the number of jobs is set to 1 unless current joblib + backend context specifies otherwise. If ``-1``, then the number of jobs is set to the number of CPU cores. + See :term:`Glossary `. Returns ------- @@ -152,14 +155,17 @@ def mean_shift(X, bandwidth=None, seeds=None, bin_seeding=False, Maximum number of iterations, per seed point before the clustering operation terminates (for that seed point), if has not converged yet. - n_jobs : int + n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. + If ``None``, then the number of jobs is set to 1 unless current joblib + backend context specifies otherwise. If -1 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one are used. + See :term:`Glossary `. .. versionadded:: 0.17 Parallel Execution using *n_jobs*. @@ -334,14 +340,17 @@ class MeanShift(BaseEstimator, ClusterMixin): not within any kernel. Orphans are assigned to the nearest kernel. If false, then orphans are given cluster label -1. - n_jobs : int + n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. + If ``None``, then the number of jobs is set to 1 unless current joblib + backend context specifies otherwise. If -1 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one are used. + See :term:`Glossary `. Attributes ---------- diff --git a/sklearn/cluster/optics_.py b/sklearn/cluster/optics_.py index b623a15f53f41..24bde0ad36de8 100755 --- a/sklearn/cluster/optics_.py +++ b/sklearn/cluster/optics_.py @@ -118,9 +118,12 @@ def optics(X, min_samples=5, max_bound=np.inf, metric='euclidean', required to store the tree. The optimal value depends on the nature of the problem. - n_jobs : int, optional (default=1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. + If ``None``, then the number of jobs is set to 1 unless current joblib + backend context specifies otherwise. If ``-1``, then the number of jobs is set to the number of CPU cores. + See :term:`Glossary `. Returns ------- @@ -243,9 +246,12 @@ class OPTICS(BaseEstimator, ClusterMixin): required to store the tree. The optimal value depends on the nature of the problem. - n_jobs : int, optional (default=1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. + If ``None``, then the number of jobs is set to 1 unless current joblib + backend context specifies otherwise. If ``-1``, then the number of jobs is set to the number of CPU cores. + See :term:`Glossary `. Attributes ---------- diff --git a/sklearn/cluster/spectral.py b/sklearn/cluster/spectral.py index 6e9290eb3d2cb..8463ab761d6ce 100644 --- a/sklearn/cluster/spectral.py +++ b/sklearn/cluster/spectral.py @@ -358,9 +358,12 @@ class SpectralClustering(BaseEstimator, ClusterMixin): Parameters (keyword arguments) and values for kernel passed as callable object. Ignored by other kernels. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run. + If ``None``, then the number of jobs is set to 1 unless current joblib + backend context specifies otherwise. If ``-1``, then the number of jobs is set to the number of CPU cores. + See :term:`Glossary `. Attributes ---------- From d94de7cf3e4d8a48fdfbb9c27a141e68f61a9b9e Mon Sep 17 00:00:00 2001 From: Hanmin Qin Date: Wed, 15 Aug 2018 20:43:05 +0800 Subject: [PATCH 2/9] more modules --- .../model_selection/plot_learning_curve.py | 9 ++-- sklearn/cluster/bicluster.py | 20 +++----- sklearn/cluster/dbscan_.py | 14 +++--- sklearn/cluster/k_means_.py | 20 +++----- sklearn/cluster/mean_shift_.py | 27 ++++------- sklearn/cluster/optics_.py | 14 +++--- sklearn/cluster/spectral.py | 7 ++- sklearn/compose/_column_transformer.py | 14 ++++-- sklearn/covariance/graph_lasso_.py | 14 ++++-- sklearn/decomposition/dict_learning.py | 40 +++++++++++----- sklearn/decomposition/kernel_pca.py | 6 ++- sklearn/decomposition/online_lda.py | 8 ++-- sklearn/decomposition/sparse_pca.py | 12 +++-- sklearn/ensemble/bagging.py | 12 +++-- sklearn/ensemble/forest.py | 30 ++++++++---- sklearn/ensemble/iforest.py | 6 ++- sklearn/ensemble/partial_dependence.py | 7 +-- sklearn/ensemble/voting_classifier.py | 6 ++- sklearn/feature_selection/rfe.py | 7 +-- sklearn/gaussian_process/gpc.py | 10 ++-- sklearn/linear_model/base.py | 7 +-- sklearn/linear_model/coordinate_descent.py | 34 ++++++++------ sklearn/linear_model/least_angle.py | 16 ++++--- sklearn/linear_model/logistic.py | 14 ++++-- sklearn/linear_model/omp.py | 8 ++-- sklearn/linear_model/passive_aggressive.py | 8 ++-- sklearn/linear_model/perceptron.py | 8 ++-- sklearn/linear_model/randomized_l1.py | 24 ++++++---- sklearn/linear_model/stochastic_gradient.py | 8 ++-- sklearn/linear_model/theil_sen.py | 8 ++-- sklearn/manifold/isomap.py | 6 ++- sklearn/manifold/locally_linear.py | 18 +++++--- sklearn/manifold/mds.py | 18 ++++---- sklearn/manifold/spectral_embedding_.py | 6 ++- sklearn/metrics/pairwise.py | 27 +++++------ sklearn/model_selection/_search.py | 10 +++- sklearn/model_selection/_validation.py | 46 ++++++++++++------- sklearn/multiclass.py | 30 ++++++------ sklearn/multioutput.py | 18 ++++---- sklearn/neighbors/classification.py | 12 +++-- sklearn/neighbors/graph.py | 12 +++-- sklearn/neighbors/lof.py | 6 ++- sklearn/neighbors/regression.py | 12 +++-- sklearn/neighbors/unsupervised.py | 6 ++- sklearn/pipeline.py | 14 ++++-- sklearn/semi_supervised/label_propagation.py | 18 +++++--- 46 files changed, 398 insertions(+), 279 deletions(-) diff --git a/examples/model_selection/plot_learning_curve.py b/examples/model_selection/plot_learning_curve.py index 6e022ebe2718a..2d6b1d335ef7d 100644 --- a/examples/model_selection/plot_learning_curve.py +++ b/examples/model_selection/plot_learning_curve.py @@ -25,7 +25,7 @@ def plot_learning_curve(estimator, title, X, y, ylim=None, cv=None, - n_jobs=1, train_sizes=np.linspace(.1, 1.0, 5)): + n_jobs=None, train_sizes=np.linspace(.1, 1.0, 5)): """ Generate a simple plot of the test and training learning curve. @@ -63,8 +63,11 @@ def plot_learning_curve(estimator, title, X, y, ylim=None, cv=None, Refer :ref:`User Guide ` for the various cross-validators that can be used here. - n_jobs : integer, optional - Number of jobs to run in parallel (default 1). + n_jobs : int or None, optional (default=None) + Number of jobs to run in parallel. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. train_sizes : array-like, shape (n_ticks,), dtype float or int Relative or absolute numbers of training examples that will be used to diff --git a/sklearn/cluster/bicluster.py b/sklearn/cluster/bicluster.py index 54e83a51dd6f4..8cb22837c9b7e 100644 --- a/sklearn/cluster/bicluster.py +++ b/sklearn/cluster/bicluster.py @@ -233,13 +233,9 @@ class SpectralCoclustering(BaseSpectral): down the pairwise matrix into n_jobs even slices and computing them in parallel. - If ``None``, then the number of jobs is set to 1 unless current joblib - backend context specifies otherwise. - If -1 all CPUs are used. If 1 is given, no parallel computing code is - used at all, which is useful for debugging. For n_jobs below -1, - (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one - are used. - See :term:`Glossary `. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None (default) Used for randomizing the singular value decomposition and the k-means @@ -383,13 +379,9 @@ class SpectralBiclustering(BaseSpectral): down the pairwise matrix into n_jobs even slices and computing them in parallel. - If ``None``, then the number of jobs is set to 1 unless current joblib - backend context specifies otherwise. - If -1 all CPUs are used. If 1 is given, no parallel computing code is - used at all, which is useful for debugging. For n_jobs below -1, - (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one - are used. - See :term:`Glossary `. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None (default) Used for randomizing the singular value decomposition and the k-means diff --git a/sklearn/cluster/dbscan_.py b/sklearn/cluster/dbscan_.py index ef2fc93a2b6ce..4c109591dfcfa 100644 --- a/sklearn/cluster/dbscan_.py +++ b/sklearn/cluster/dbscan_.py @@ -78,10 +78,9 @@ def dbscan(X, eps=0.5, min_samples=5, metric='minkowski', metric_params=None, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``None``, then the number of jobs is set to 1 unless current joblib - backend context specifies otherwise. - If ``-1``, then the number of jobs is set to the number of CPU cores. - See :term:`Glossary `. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Returns ------- @@ -234,10 +233,9 @@ class DBSCAN(BaseEstimator, ClusterMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - If ``None``, then the number of jobs is set to 1 unless current joblib - backend context specifies otherwise. - If ``-1``, then the number of jobs is set to the number of CPU cores. - See :term:`Glossary `. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- diff --git a/sklearn/cluster/k_means_.py b/sklearn/cluster/k_means_.py index d542a1c1be550..cf7c114fec0c1 100644 --- a/sklearn/cluster/k_means_.py +++ b/sklearn/cluster/k_means_.py @@ -265,13 +265,9 @@ def k_means(X, n_clusters, sample_weight=None, init='k-means++', The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. - If ``None``, then the number of jobs is set to 1 unless current joblib - backend context specifies otherwise. - If -1 all CPUs are used. If 1 is given, no parallel computing code is - used at all, which is useful for debugging. For n_jobs below -1, - (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one - are used. - See :term:`Glossary `. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. algorithm : "auto", "full" or "elkan", default="auto" K-means algorithm to use. The classical EM-style algorithm is "full". @@ -841,13 +837,9 @@ class KMeans(BaseEstimator, ClusterMixin, TransformerMixin): The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. - If ``None``, then the number of jobs is set to 1 unless current joblib - backend context specifies otherwise. - If -1 all CPUs are used. If 1 is given, no parallel computing code is - used at all, which is useful for debugging. For n_jobs below -1, - (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one - are used. - See :term:`Glossary `. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. algorithm : "auto", "full" or "elkan", default="auto" K-means algorithm to use. The classical EM-style algorithm is "full". diff --git a/sklearn/cluster/mean_shift_.py b/sklearn/cluster/mean_shift_.py index 1a9a9db9dfa51..cc362433c4dd6 100644 --- a/sklearn/cluster/mean_shift_.py +++ b/sklearn/cluster/mean_shift_.py @@ -55,10 +55,9 @@ def estimate_bandwidth(X, quantile=0.3, n_samples=None, random_state=0, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``None``, then the number of jobs is set to 1 unless current joblib - backend context specifies otherwise. - If ``-1``, then the number of jobs is set to the number of CPU cores. - See :term:`Glossary `. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Returns ------- @@ -159,13 +158,9 @@ def mean_shift(X, bandwidth=None, seeds=None, bin_seeding=False, The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. - If ``None``, then the number of jobs is set to 1 unless current joblib - backend context specifies otherwise. - If -1 all CPUs are used. If 1 is given, no parallel computing code is - used at all, which is useful for debugging. For n_jobs below -1, - (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one - are used. - See :term:`Glossary `. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. .. versionadded:: 0.17 Parallel Execution using *n_jobs*. @@ -344,13 +339,9 @@ class MeanShift(BaseEstimator, ClusterMixin): The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. - If ``None``, then the number of jobs is set to 1 unless current joblib - backend context specifies otherwise. - If -1 all CPUs are used. If 1 is given, no parallel computing code is - used at all, which is useful for debugging. For n_jobs below -1, - (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one - are used. - See :term:`Glossary `. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- diff --git a/sklearn/cluster/optics_.py b/sklearn/cluster/optics_.py index 24bde0ad36de8..bd7df5d367372 100755 --- a/sklearn/cluster/optics_.py +++ b/sklearn/cluster/optics_.py @@ -120,10 +120,9 @@ def optics(X, min_samples=5, max_bound=np.inf, metric='euclidean', n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``None``, then the number of jobs is set to 1 unless current joblib - backend context specifies otherwise. - If ``-1``, then the number of jobs is set to the number of CPU cores. - See :term:`Glossary `. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Returns ------- @@ -248,10 +247,9 @@ class OPTICS(BaseEstimator, ClusterMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``None``, then the number of jobs is set to 1 unless current joblib - backend context specifies otherwise. - If ``-1``, then the number of jobs is set to the number of CPU cores. - See :term:`Glossary `. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- diff --git a/sklearn/cluster/spectral.py b/sklearn/cluster/spectral.py index 8463ab761d6ce..feb316ad483e4 100644 --- a/sklearn/cluster/spectral.py +++ b/sklearn/cluster/spectral.py @@ -360,10 +360,9 @@ class SpectralClustering(BaseEstimator, ClusterMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - If ``None``, then the number of jobs is set to 1 unless current joblib - backend context specifies otherwise. - If ``-1``, then the number of jobs is set to the number of CPU cores. - See :term:`Glossary `. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- diff --git a/sklearn/compose/_column_transformer.py b/sklearn/compose/_column_transformer.py index 13f38563ac485..cc35e358c4d0c 100644 --- a/sklearn/compose/_column_transformer.py +++ b/sklearn/compose/_column_transformer.py @@ -93,8 +93,11 @@ class ColumnTransformer(_BaseComposition, TransformerMixin): the stacked result will be sparse or dense, respectively, and this keyword will be ignored. - n_jobs : int, optional - Number of jobs to run in parallel (default 1). + n_jobs : int or None, optional (default=None) + Number of jobs to run in parallel. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. transformer_weights : dict, optional Multiplicative weights for features per transformer. The output of the @@ -666,8 +669,11 @@ def make_column_transformer(*transformers, **kwargs): non-specified columns will use the ``remainder`` estimator. The estimator must support `fit` and `transform`. - n_jobs : int, optional - Number of jobs to run in parallel (default 1). + n_jobs : int or None, optional (default=None) + Number of jobs to run in parallel. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Returns ------- diff --git a/sklearn/covariance/graph_lasso_.py b/sklearn/covariance/graph_lasso_.py index a116d9919feb8..01838b7972798 100644 --- a/sklearn/covariance/graph_lasso_.py +++ b/sklearn/covariance/graph_lasso_.py @@ -520,8 +520,11 @@ class GraphicalLassoCV(GraphicalLasso): than number of samples. Elsewhere prefer cd which is more numerically stable. - n_jobs : int, optional - number of jobs to run in parallel (default 1). + n_jobs : int or None, optional (default=None) + number of jobs to run in parallel. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. verbose : boolean, optional If verbose is True, the objective function and duality gap are @@ -927,8 +930,11 @@ class GraphLassoCV(GraphicalLassoCV): than number of samples. Elsewhere prefer cd which is more numerically stable. - n_jobs : int, optional - number of jobs to run in parallel (default 1). + n_jobs : int or None, optional (default=None) + number of jobs to run in parallel. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. verbose : boolean, optional If verbose is True, the objective function and duality gap are diff --git a/sklearn/decomposition/dict_learning.py b/sklearn/decomposition/dict_learning.py index b0cf6828129da..29bf9ecb3e044 100644 --- a/sklearn/decomposition/dict_learning.py +++ b/sklearn/decomposition/dict_learning.py @@ -246,8 +246,11 @@ def sparse_encode(X, dictionary, gram=None, cov=None, algorithm='lasso_lars', max_iter : int, 1000 by default Maximum number of iterations to perform if `algorithm='lasso_cd'`. - n_jobs : int, optional + n_jobs : int or None, optional (default=None) Number of parallel jobs to run. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. check_input : boolean, optional If False, the input arrays X and dictionary will not be checked. @@ -459,8 +462,11 @@ def dict_learning(X, n_components, alpha, max_iter=100, tol=1e-8, Lasso solution (linear_model.Lasso). Lars will be faster if the estimated components are sparse. - n_jobs : int, - Number of parallel jobs to run, or -1 to autodetect. + n_jobs : int or None, optional (default=None) + Number of parallel jobs to run. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. dict_init : array of shape (n_components, n_features), Initial value for the dictionary for warm restart scenarios. @@ -654,8 +660,11 @@ def dict_learning_online(X, n_components=2, alpha=1, n_iter=100, shuffle : boolean, Whether to shuffle the data before splitting it in batches. - n_jobs : int, - Number of parallel jobs to run, or -1 to autodetect. + n_jobs : int or None, optional (default=None) + Number of parallel jobs to run. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. method : {'lars', 'cd'} lars: uses the least angle regression method to solve the lasso problem @@ -949,8 +958,11 @@ class SparseCoder(BaseEstimator, SparseCodingMixin): its negative part and its positive part. This can improve the performance of downstream classifiers. - n_jobs : int, - number of parallel jobs to run + n_jobs : int or None, optional (default=None) + number of parallel jobs to run. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. positive_code : bool Whether to enforce positivity when finding the code. @@ -1069,8 +1081,11 @@ class DictionaryLearning(BaseEstimator, SparseCodingMixin): the reconstruction error targeted. In this case, it overrides `n_nonzero_coefs`. - n_jobs : int, - number of parallel jobs to run + n_jobs : int or None, optional (default=None) + number of parallel jobs to run. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. code_init : array of shape (n_samples, n_components), initial value for the code, for warm restart @@ -1220,8 +1235,11 @@ class MiniBatchDictionaryLearning(BaseEstimator, SparseCodingMixin): Lasso solution (linear_model.Lasso). Lars will be faster if the estimated components are sparse. - n_jobs : int, - number of parallel jobs to run + n_jobs : int or None, optional (default=None) + number of parallel jobs to run。 + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. batch_size : int, number of samples in each mini-batch diff --git a/sklearn/decomposition/kernel_pca.py b/sklearn/decomposition/kernel_pca.py index 60b93ae3d6944..5a5dc31ba8e94 100644 --- a/sklearn/decomposition/kernel_pca.py +++ b/sklearn/decomposition/kernel_pca.py @@ -89,9 +89,11 @@ class KernelPCA(BaseEstimator, TransformerMixin): .. versionadded:: 0.18 - n_jobs : int, default=1 + n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - If `-1`, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. .. versionadded:: 0.18 diff --git a/sklearn/decomposition/online_lda.py b/sklearn/decomposition/online_lda.py index f9fa165eb0bf7..c106c34fb5354 100644 --- a/sklearn/decomposition/online_lda.py +++ b/sklearn/decomposition/online_lda.py @@ -215,9 +215,11 @@ class LatentDirichletAllocation(BaseEstimator, TransformerMixin): Max number of iterations for updating document topic distribution in the E-step. - n_jobs : int, optional (default=1) - The number of jobs to use in the E-step. If -1, all CPUs are used. For - ``n_jobs`` below -1, (n_cpus + 1 + n_jobs) are used. + n_jobs : int or None, optional (default=None) + The number of jobs to use in the E-step. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. verbose : int, optional (default=0) Verbosity level. diff --git a/sklearn/decomposition/sparse_pca.py b/sklearn/decomposition/sparse_pca.py index f34dcbf3762a3..43a607eaeea72 100644 --- a/sklearn/decomposition/sparse_pca.py +++ b/sklearn/decomposition/sparse_pca.py @@ -48,8 +48,11 @@ class SparsePCA(BaseEstimator, TransformerMixin): Lasso solution (linear_model.Lasso). Lars will be faster if the estimated components are sparse. - n_jobs : int, + n_jobs : int or None, optional (default=None) Number of parallel jobs to run. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. U_init : array of shape (n_samples, n_components), Initial values for the loadings for warm restart scenarios. @@ -269,8 +272,11 @@ class MiniBatchSparsePCA(SparsePCA): shuffle : boolean, whether to shuffle the data before splitting it in batches - n_jobs : int, - number of parallel jobs to run, or -1 to autodetect. + n_jobs : int or None, optional (default=None) + number of parallel jobs to run。 + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. method : {'lars', 'cd'} lars: uses the least angle regression method to solve the lasso problem diff --git a/sklearn/ensemble/bagging.py b/sklearn/ensemble/bagging.py index c019bad82e1b8..14184778629fb 100644 --- a/sklearn/ensemble/bagging.py +++ b/sklearn/ensemble/bagging.py @@ -484,9 +484,11 @@ class BaggingClassifier(BaseBagging, ClassifierMixin): .. versionadded:: 0.17 *warm_start* constructor parameter. - n_jobs : int, optional (default=1) + n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - If -1, then the number of jobs is set to the number of cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional (default=None) If int, random_state is the seed used by the random number generator; @@ -860,9 +862,11 @@ class BaggingRegressor(BaseBagging, RegressorMixin): and add more estimators to the ensemble, otherwise, just fit a whole new ensemble. See :term:`the Glossary `. - n_jobs : int, optional (default=1) + n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - If -1, then the number of jobs is set to the number of cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional (default=None) If int, random_state is the seed used by the random number generator; diff --git a/sklearn/ensemble/forest.py b/sklearn/ensemble/forest.py index fb2d3025bf653..a2ab75f44768e 100644 --- a/sklearn/ensemble/forest.py +++ b/sklearn/ensemble/forest.py @@ -863,9 +863,11 @@ class RandomForestClassifier(ForestClassifier): Whether to use out-of-bag samples to estimate the generalization accuracy. - n_jobs : integer, optional (default=1) + n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - If -1, then the number of jobs is set to the number of cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional (default=None) If int, random_state is the seed used by the random number generator; @@ -1146,9 +1148,11 @@ class RandomForestRegressor(ForestRegressor): whether to use out-of-bag samples to estimate the R^2 on unseen data. - n_jobs : integer, optional (default=1) + n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - If -1, then the number of jobs is set to the number of cores. + `None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional (default=None) If int, random_state is the seed used by the random number generator; @@ -1382,9 +1386,11 @@ class ExtraTreesClassifier(ForestClassifier): Whether to use out-of-bag samples to estimate the generalization accuracy. - n_jobs : integer, optional (default=1) + n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - If -1, then the number of jobs is set to the number of cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional (default=None) If int, random_state is the seed used by the random number generator; @@ -1635,9 +1641,11 @@ class ExtraTreesRegressor(ForestRegressor): oob_score : bool, optional (default=False) Whether to use out-of-bag samples to estimate the R^2 on unseen data. - n_jobs : integer, optional (default=1) + n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - If -1, then the number of jobs is set to the number of cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional (default=None) If int, random_state is the seed used by the random number generator; @@ -1827,9 +1835,11 @@ class RandomTreesEmbedding(BaseForest): Whether or not to return a sparse CSR matrix, as default behavior, or to return a dense array compatible with dense pipeline operators. - n_jobs : integer, optional (default=1) + n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - If -1, then the number of jobs is set to the number of cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional (default=None) If int, random_state is the seed used by the random number generator; diff --git a/sklearn/ensemble/iforest.py b/sklearn/ensemble/iforest.py index b0f9a37c9e7f6..1bd59542f8458 100644 --- a/sklearn/ensemble/iforest.py +++ b/sklearn/ensemble/iforest.py @@ -85,9 +85,11 @@ class IsolationForest(BaseBagging, OutlierMixin): data sampled with replacement. If False, sampling without replacement is performed. - n_jobs : integer, optional (default=1) + n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - If -1, then the number of jobs is set to the number of cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. behaviour : str, default='old' Behaviour of the ``decision_function`` which can be either 'old' or diff --git a/sklearn/ensemble/partial_dependence.py b/sklearn/ensemble/partial_dependence.py index 6e4f0ed6413da..72818e83512bb 100644 --- a/sklearn/ensemble/partial_dependence.py +++ b/sklearn/ensemble/partial_dependence.py @@ -203,9 +203,10 @@ def plot_partial_dependence(gbrt, X, features, feature_names=None, percentiles : (low, high), default=(0.05, 0.95) The lower and upper percentile used to create the extreme values for the PDP axes. - n_jobs : int - The number of CPUs to use to compute the PDs. -1 means 'all CPUs'. - Defaults to 1. + n_jobs : int or None, optional (default=None) + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. verbose : int Verbose output during PD computations. Defaults to 0. ax : Matplotlib axis object, default None diff --git a/sklearn/ensemble/voting_classifier.py b/sklearn/ensemble/voting_classifier.py index e585947f11aad..0554ab6edfea0 100644 --- a/sklearn/ensemble/voting_classifier.py +++ b/sklearn/ensemble/voting_classifier.py @@ -59,9 +59,11 @@ class VotingClassifier(_BaseComposition, ClassifierMixin, TransformerMixin): predicted class labels (`hard` voting) or class probabilities before averaging (`soft` voting). Uses uniform weights if `None`. - n_jobs : int, optional (default=1) + n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for ``fit``. - If -1, then the number of jobs is set to the number of cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. flatten_transform : bool, optional (default=None) Affects shape of transform output only when voting='soft' diff --git a/sklearn/feature_selection/rfe.py b/sklearn/feature_selection/rfe.py index b6df8ad962b4c..534f1b33b1cfa 100644 --- a/sklearn/feature_selection/rfe.py +++ b/sklearn/feature_selection/rfe.py @@ -377,10 +377,11 @@ class RFECV(RFE, MetaEstimatorMixin): verbose : int, (default=0) Controls verbosity of output. - n_jobs : int, (default=1) + n_jobs : int or None, optional (default=None) Number of cores to run in parallel while fitting across folds. - Defaults to 1 core. If ``n_jobs=-1``, then number of jobs is set - to number of cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- diff --git a/sklearn/gaussian_process/gpc.py b/sklearn/gaussian_process/gpc.py index 2389a2c5ef937..2a74248c274f4 100644 --- a/sklearn/gaussian_process/gpc.py +++ b/sklearn/gaussian_process/gpc.py @@ -534,11 +534,11 @@ def optimizer(obj_func, initial_theta, bounds): Note that "one_vs_one" does not support predicting probability estimates. - n_jobs : int, optional, default: 1 - The number of jobs to use for the computation. If -1 all CPUs are used. - If 1 is given, no parallel computing code is used at all, which is - useful for debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are - used. Thus for n_jobs = -2, all CPUs but one are used. + n_jobs : int or None, optional (default=None) + The number of jobs to use for the computation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- diff --git a/sklearn/linear_model/base.py b/sklearn/linear_model/base.py index e626c84f4cd93..d75ed6ded4497 100644 --- a/sklearn/linear_model/base.py +++ b/sklearn/linear_model/base.py @@ -381,10 +381,11 @@ class LinearRegression(LinearModel, RegressorMixin): copy_X : boolean, optional, default True If True, X will be copied; else, it may be overwritten. - n_jobs : int, optional, default 1 + n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. - If -1 all CPUs are used. This will only provide speedup for - n_targets > 1 and sufficient large problems. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- diff --git a/sklearn/linear_model/coordinate_descent.py b/sklearn/linear_model/coordinate_descent.py index 09736927bea63..ad715060db30b 100644 --- a/sklearn/linear_model/coordinate_descent.py +++ b/sklearn/linear_model/coordinate_descent.py @@ -1320,9 +1320,11 @@ class LassoCV(LinearModelCV, RegressorMixin): verbose : bool or integer Amount of verbosity. - n_jobs : integer, optional - Number of CPUs to use during the cross validation. If ``-1``, use - all the CPUs. + n_jobs : int or None, optional (default=None) + Number of CPUs to use during the cross validation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. positive : bool, optional If positive, restrict regression coefficients to be positive @@ -1480,9 +1482,11 @@ class ElasticNetCV(LinearModelCV, RegressorMixin): verbose : bool or integer Amount of verbosity. - n_jobs : integer, optional - Number of CPUs to use during the cross validation. If ``-1``, use - all the CPUs. + n_jobs : int or None, optional (default=None) + Number of CPUs to use during the cross validation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. positive : bool, optional When set to ``True``, forces the coefficients to be positive. @@ -2014,10 +2018,11 @@ class MultiTaskElasticNetCV(LinearModelCV, RegressorMixin): verbose : bool or integer Amount of verbosity. - n_jobs : integer, optional - Number of CPUs to use during the cross validation. If ``-1``, use - all the CPUs. Note that this is used only if multiple values for - l1_ratio are given. + n_jobs : int or None, optional (default=None) + Number of CPUs to use during the cross validation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional, default None The seed of the pseudo random number generator that selects a random @@ -2186,10 +2191,11 @@ class MultiTaskLassoCV(LinearModelCV, RegressorMixin): verbose : bool or integer Amount of verbosity. - n_jobs : integer, optional - Number of CPUs to use during the cross validation. If ``-1``, use - all the CPUs. Note that this is used only if multiple values for - l1_ratio are given. + n_jobs : int or None, optional (default=None) + Number of CPUs to use during the cross validation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional, default None The seed of the pseudo random number generator that selects a random diff --git a/sklearn/linear_model/least_angle.py b/sklearn/linear_model/least_angle.py index dd47030308d40..ab7e7c7a45397 100644 --- a/sklearn/linear_model/least_angle.py +++ b/sklearn/linear_model/least_angle.py @@ -1022,9 +1022,11 @@ class LarsCV(Lars): The maximum number of points on the path used to compute the residuals in the cross-validation - n_jobs : integer, optional - Number of CPUs to use during the cross validation. If ``-1``, use - all the CPUs + n_jobs : int or None, optional (default=None) + Number of CPUs to use during the cross validation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. eps : float, optional The machine-precision regularization in the computation of the @@ -1235,9 +1237,11 @@ class LassoLarsCV(LarsCV): The maximum number of points on the path used to compute the residuals in the cross-validation - n_jobs : integer, optional - Number of CPUs to use during the cross validation. If ``-1``, use - all the CPUs + n_jobs : int or None, optional (default=None) + Number of CPUs to use during the cross validation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. eps : float, optional The machine-precision regularization in the computation of the diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py index 7494b650dc9bc..4e72d983b21fc 100644 --- a/sklearn/linear_model/logistic.py +++ b/sklearn/linear_model/logistic.py @@ -1093,11 +1093,13 @@ class LogisticRegression(BaseEstimator, LinearClassifierMixin, .. versionadded:: 0.17 *warm_start* to support *lbfgs*, *newton-cg*, *sag*, *saga* solvers. - n_jobs : int, default: 1 + n_jobs : int or None, optional (default=None) Number of CPU cores used when parallelizing over classes if multi_class='ovr'". This parameter is ignored when the ``solver`` is set to 'liblinear' regardless of whether 'multi_class' is specified or - not. If given a value of -1, all cores are used. + not. ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- @@ -1495,9 +1497,11 @@ class LogisticRegressionCV(LogisticRegression, BaseEstimator, .. versionadded:: 0.17 class_weight == 'balanced' - n_jobs : int, optional - Number of CPU cores used during the cross-validation loop. If given - a value of -1, all cores are used. + n_jobs : int or None, optional (default=None) + Number of CPU cores used during the cross-validation loop. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. verbose : int For the 'liblinear', 'sag' and 'lbfgs' solvers set verbose to any diff --git a/sklearn/linear_model/omp.py b/sklearn/linear_model/omp.py index 084336bbb160c..35f1baecc46e1 100644 --- a/sklearn/linear_model/omp.py +++ b/sklearn/linear_model/omp.py @@ -789,9 +789,11 @@ class OrthogonalMatchingPursuitCV(LinearModel, RegressorMixin): ``cv`` default value if None will change from 3-fold to 5-fold in v0.22. - n_jobs : integer, optional - Number of CPUs to use during the cross validation. If ``-1``, use - all the CPUs + n_jobs : int or None, optional (default=None) + Number of CPUs to use during the cross validation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. verbose : boolean or integer, optional Sets the verbosity amount diff --git a/sklearn/linear_model/passive_aggressive.py b/sklearn/linear_model/passive_aggressive.py index 7a04f774815a8..c2012707e21ee 100644 --- a/sklearn/linear_model/passive_aggressive.py +++ b/sklearn/linear_model/passive_aggressive.py @@ -68,10 +68,12 @@ class PassiveAggressiveClassifier(BaseSGDClassifier): hinge: equivalent to PA-I in the reference paper. squared_hinge: equivalent to PA-II in the reference paper. - n_jobs : integer, optional + n_jobs : int or None, optional (default=None) The number of CPUs to use to do the OVA (One Versus All, for - multi-class problems) computation. -1 means 'all CPUs'. Defaults - to 1. + multi-class problems) computation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional, default=None The seed of the pseudo random number generator to use when shuffling diff --git a/sklearn/linear_model/perceptron.py b/sklearn/linear_model/perceptron.py index 3e24be23c1d15..dc72145fcb848 100644 --- a/sklearn/linear_model/perceptron.py +++ b/sklearn/linear_model/perceptron.py @@ -47,10 +47,12 @@ class Perceptron(BaseSGDClassifier): eta0 : double Constant by which the updates are multiplied. Defaults to 1. - n_jobs : integer, optional + n_jobs : int or None, optional (default=None) The number of CPUs to use to do the OVA (One Versus All, for - multi-class problems) computation. -1 means 'all CPUs'. Defaults - to 1. + multi-class problems) computation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional, default None The seed of the pseudo random number generator to use when shuffling diff --git a/sklearn/linear_model/randomized_l1.py b/sklearn/linear_model/randomized_l1.py index 0a2830518505a..fc746d9487235 100644 --- a/sklearn/linear_model/randomized_l1.py +++ b/sklearn/linear_model/randomized_l1.py @@ -257,9 +257,11 @@ class RandomizedLasso(BaseRandomizedLinearModel): If None, the random number generator is the RandomState instance used by `np.random`. - n_jobs : integer, optional - Number of CPUs to use during the resampling. If '-1', use - all the CPUs + n_jobs : int or None, optional (default=None) + Number of CPUs to use during the resampling. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. pre_dispatch : int, or string, optional Controls the number of jobs that get dispatched during parallel @@ -451,9 +453,11 @@ class RandomizedLogisticRegression(BaseRandomizedLinearModel): If None, the random number generator is the RandomState instance used by `np.random`. - n_jobs : integer, optional - Number of CPUs to use during the resampling. If '-1', use - all the CPUs + n_jobs : int or None, optional (default=None) + Number of CPUs to use during the resampling. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. pre_dispatch : int, or string, optional Controls the number of jobs that get dispatched during parallel @@ -608,9 +612,11 @@ def lasso_stability_path(X, y, scaling=0.5, random_state=None, eps : float, optional Smallest value of alpha / alpha_max considered - n_jobs : integer, optional - Number of CPUs to use during the resampling. If '-1', use - all the CPUs + n_jobs : int or None, optional (default=None) + Number of CPUs to use during the resampling. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. verbose : boolean or integer, optional Sets the verbosity amount diff --git a/sklearn/linear_model/stochastic_gradient.py b/sklearn/linear_model/stochastic_gradient.py index a4c5938cb136c..fe8e726324c6d 100644 --- a/sklearn/linear_model/stochastic_gradient.py +++ b/sklearn/linear_model/stochastic_gradient.py @@ -806,10 +806,12 @@ class SGDClassifier(BaseSGDClassifier): For epsilon-insensitive, any differences between the current prediction and the correct label are ignored if they are less than this threshold. - n_jobs : integer, optional + n_jobs : int or None, optional (default=None) The number of CPUs to use to do the OVA (One Versus All, for - multi-class problems) computation. -1 means 'all CPUs'. Defaults - to 1. + multi-class problems) computation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional (default=None) The seed of the pseudo random number generator to use when shuffling diff --git a/sklearn/linear_model/theil_sen.py b/sklearn/linear_model/theil_sen.py index 62cdc36aaffd6..e84647a2fafc6 100644 --- a/sklearn/linear_model/theil_sen.py +++ b/sklearn/linear_model/theil_sen.py @@ -249,9 +249,11 @@ class TheilSenRegressor(LinearModel, RegressorMixin): random number generator; If None, the random number generator is the RandomState instance used by `np.random`. - n_jobs : integer, optional, default 1 - Number of CPUs to use during the cross validation. If ``-1``, use - all the CPUs. + n_jobs : int or None, optional (default=None) + Number of CPUs to use during the cross validation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. verbose : boolean, optional, default False Verbose mode when fitting the model. diff --git a/sklearn/manifold/isomap.py b/sklearn/manifold/isomap.py index cc2bca1c1c0c8..c270dcc0bf75a 100644 --- a/sklearn/manifold/isomap.py +++ b/sklearn/manifold/isomap.py @@ -58,9 +58,11 @@ class Isomap(BaseEstimator, TransformerMixin): Algorithm to use for nearest neighbors search, passed to neighbors.NearestNeighbors instance. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- diff --git a/sklearn/manifold/locally_linear.py b/sklearn/manifold/locally_linear.py index a30084abd506b..ae8eea82ee2d7 100644 --- a/sklearn/manifold/locally_linear.py +++ b/sklearn/manifold/locally_linear.py @@ -81,9 +81,11 @@ def barycenter_kneighbors_graph(X, n_neighbors, reg=1e-3, n_jobs=None): problem. Only relevant if mode='barycenter'. If None, use the default. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Returns ------- @@ -253,9 +255,11 @@ def locally_linear_embedding( If None, the random number generator is the RandomState instance used by `np.random`. Used when ``solver`` == 'arpack'. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Returns ------- @@ -582,9 +586,11 @@ class LocallyLinearEmbedding(BaseEstimator, TransformerMixin): If None, the random number generator is the RandomState instance used by `np.random`. Used when ``eigen_solver`` == 'arpack'. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- diff --git a/sklearn/manifold/mds.py b/sklearn/manifold/mds.py index 3ef750d4cb9f2..3154f1fea361c 100644 --- a/sklearn/manifold/mds.py +++ b/sklearn/manifold/mds.py @@ -178,15 +178,14 @@ def smacof(dissimilarities, metric=True, n_components=2, init=None, n_init=8, determined by the run with the smallest final stress. If ``init`` is provided, this option is overridden and a single run is performed. - n_jobs : int, optional, default: 1 + n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. If multiple initializations are used (``n_init``), each run of the algorithm is computed in parallel. - If -1 all CPUs are used. If 1 is given, no parallel computing code is - used at all, which is useful for debugging. For ``n_jobs`` below -1, - (``n_cpus + 1 + n_jobs``) are used. Thus for ``n_jobs = -2``, all CPUs - but one are used. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. max_iter : int, optional, default: 300 Maximum number of iterations of the SMACOF algorithm for a single run. @@ -305,15 +304,14 @@ class MDS(BaseEstimator): Relative tolerance with respect to stress at which to declare convergence. - n_jobs : int, optional, default: 1 + n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. If multiple initializations are used (``n_init``), each run of the algorithm is computed in parallel. - If -1 all CPUs are used. If 1 is given, no parallel computing code is - used at all, which is useful for debugging. For ``n_jobs`` below -1, - (``n_cpus + 1 + n_jobs``) are used. Thus for ``n_jobs = -2``, all CPUs - but one are used. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional, default: None The generator used to initialize the centers. If int, random_state is diff --git a/sklearn/manifold/spectral_embedding_.py b/sklearn/manifold/spectral_embedding_.py index d23a988cc3a54..a1ee199fd521f 100644 --- a/sklearn/manifold/spectral_embedding_.py +++ b/sklearn/manifold/spectral_embedding_.py @@ -382,9 +382,11 @@ class SpectralEmbedding(BaseEstimator): n_neighbors : int, default : max(n_samples/10 , 1) Number of nearest neighbors for nearest_neighbors graph building. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- diff --git a/sklearn/metrics/pairwise.py b/sklearn/metrics/pairwise.py index de86477d3d506..44b682e1a56df 100644 --- a/sklearn/metrics/pairwise.py +++ b/sklearn/metrics/pairwise.py @@ -1181,15 +1181,14 @@ def pairwise_distances_chunked(X, Y=None, reduce_func=None, should take two arrays from X as input and return a value indicating the distance between them. - n_jobs : int + n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. This works by breaking down the pairwise matrix into n_jobs even slices and computing them in parallel. - If -1 all CPUs are used. If 1 is given, no parallel computing code is - used at all, which is useful for debugging. For n_jobs below -1, - (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one - are used. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. working_memory : int, optional The sought maximum memory for temporary distance matrix chunks. @@ -1344,15 +1343,14 @@ def pairwise_distances(X, Y=None, metric="euclidean", n_jobs=None, **kwds): should take two arrays from X as input and return a value indicating the distance between them. - n_jobs : int + n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. This works by breaking down the pairwise matrix into n_jobs even slices and computing them in parallel. - If -1 all CPUs are used. If 1 is given, no parallel computing code is - used at all, which is useful for debugging. For n_jobs below -1, - (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one - are used. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. **kwds : optional keyword parameters Any further parameters are passed directly to the distance function. @@ -1515,15 +1513,14 @@ def pairwise_kernels(X, Y=None, metric="linear", filter_params=False, filter_params : boolean Whether to filter invalid parameters or not. - n_jobs : int + n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. This works by breaking down the pairwise matrix into n_jobs even slices and computing them in parallel. - If -1 all CPUs are used. If 1 is given, no parallel computing code is - used at all, which is useful for debugging. For n_jobs below -1, - (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one - are used. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. **kwds : optional keyword parameters Any further parameters are passed directly to the kernel function. diff --git a/sklearn/model_selection/_search.py b/sklearn/model_selection/_search.py index d7bf45c61677c..19b3f8c3bf71a 100644 --- a/sklearn/model_selection/_search.py +++ b/sklearn/model_selection/_search.py @@ -903,8 +903,11 @@ class GridSearchCV(BaseSearchCV): 0.19 and will be removed in version 0.21. Pass fit parameters to the ``fit`` method instead. - n_jobs : int, default=1 + n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. pre_dispatch : int, or string, optional Controls the number of jobs that get dispatched during parallel @@ -1247,8 +1250,11 @@ class RandomizedSearchCV(BaseSearchCV): 0.19 and will be removed in version 0.21. Pass fit parameters to the ``fit`` method instead. - n_jobs : int, default=1 + n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. pre_dispatch : int, or string, optional Controls the number of jobs that get dispatched during parallel diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index f2e1649e24aaa..28fc3e6ef844e 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -97,9 +97,11 @@ def cross_validate(estimator, X, y=None, groups=None, scoring=None, cv='warn', ``cv`` default value if None will change from 3-fold to 5-fold in v0.22. - n_jobs : integer, optional - The number of CPUs to use to do the computation. -1 means - 'all CPUs'. + n_jobs : int or None, optional (default=None) + The number of CPUs to use to do the computation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. verbose : integer, optional The verbosity level. @@ -319,9 +321,11 @@ def cross_val_score(estimator, X, y=None, groups=None, scoring=None, cv='warn', ``cv`` default value if None will change from 3-fold to 5-fold in v0.22. - n_jobs : integer, optional - The number of CPUs to use to do the computation. -1 means - 'all CPUs'. + n_jobs : int or None, optional (default=None) + The number of CPUs to use to do the computation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. verbose : integer, optional The verbosity level. @@ -692,9 +696,11 @@ def cross_val_predict(estimator, X, y=None, groups=None, cv='warn', ``cv`` default value if None will change from 3-fold to 5-fold in v0.22. - n_jobs : integer, optional - The number of CPUs to use to do the computation. -1 means - 'all CPUs'. + n_jobs : int or None, optional (default=None) + The number of CPUs to use to do the computation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. verbose : integer, optional The verbosity level. @@ -984,9 +990,11 @@ def permutation_test_score(estimator, X, y, groups=None, cv='warn', n_permutations : integer, optional Number of times to permute ``y``. - n_jobs : integer, optional - The number of CPUs to use to do the computation. -1 means - 'all CPUs'. + n_jobs : int or None, optional (default=None) + The number of CPUs to use to do the computation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. random_state : int, RandomState instance or None, optional (default=0) If int, random_state is the seed used by the random number generator; @@ -1140,8 +1148,11 @@ def learning_curve(estimator, X, y, groups=None, If the estimator supports incremental learning, this will be used to speed up fitting for different training set sizes. - n_jobs : integer, optional - Number of jobs to run in parallel (default 1). + n_jobs : int or None, optional (default=None) + Number of jobs to run in parallel. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. pre_dispatch : integer or string, optional Number of predispatched jobs for parallel execution (default is @@ -1384,8 +1395,11 @@ def validation_curve(estimator, X, y, param_name, param_range, groups=None, a scorer callable object / function with signature ``scorer(estimator, X, y)``. - n_jobs : integer, optional - Number of jobs to run in parallel (default 1). + n_jobs : int or None, optional (default=None) + Number of jobs to run in parallel. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. pre_dispatch : integer or string, optional Number of predispatched jobs for parallel execution (default is diff --git a/sklearn/multiclass.py b/sklearn/multiclass.py index 61f1f02e40abd..588a46ed1b443 100644 --- a/sklearn/multiclass.py +++ b/sklearn/multiclass.py @@ -157,11 +157,11 @@ class OneVsRestClassifier(BaseEstimator, ClassifierMixin, MetaEstimatorMixin): An estimator object implementing `fit` and one of `decision_function` or `predict_proba`. - n_jobs : int, optional, default: 1 - The number of jobs to use for the computation. If -1 all CPUs are used. - If 1 is given, no parallel computing code is used at all, which is - useful for debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are - used. Thus for n_jobs = -2, all CPUs but one are used. + n_jobs : int or None, optional (default=None) + The number of jobs to use for the computation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- @@ -456,11 +456,11 @@ class OneVsOneClassifier(BaseEstimator, ClassifierMixin, MetaEstimatorMixin): An estimator object implementing `fit` and one of `decision_function` or `predict_proba`. - n_jobs : int, optional, default: 1 - The number of jobs to use for the computation. If -1 all CPUs are used. - If 1 is given, no parallel computing code is used at all, which is - useful for debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are - used. Thus for n_jobs = -2, all CPUs but one are used. + n_jobs : int or None, optional (default=None) + The number of jobs to use for the computation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- @@ -662,11 +662,11 @@ class OutputCodeClassifier(BaseEstimator, ClassifierMixin, MetaEstimatorMixin): random_state is the random number generator; If None, the random number generator is the RandomState instance used by `np.random`. - n_jobs : int, optional, default: 1 - The number of jobs to use for the computation. If -1 all CPUs are used. - If 1 is given, no parallel computing code is used at all, which is - useful for debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are - used. Thus for n_jobs = -2, all CPUs but one are used. + n_jobs : int or None, optional (default=None) + The number of jobs to use for the computation. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- diff --git a/sklearn/multioutput.py b/sklearn/multioutput.py index dfaef803544a0..b9e7c498b90c6 100644 --- a/sklearn/multioutput.py +++ b/sklearn/multioutput.py @@ -209,9 +209,12 @@ class MultiOutputRegressor(MultiOutputEstimator, RegressorMixin): estimator : estimator object An estimator object implementing `fit` and `predict`. - n_jobs : int, optional, default=1 - The number of jobs to run in parallel for `fit`. If -1, - then the number of jobs is set to the number of cores. + n_jobs : int or None, optional (default=None) + The number of jobs to run in parallel for `fit`. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. + When individual estimators are fast to train or predict using `n_jobs>1` can result in slower performance due to the overhead of spawning processes. @@ -295,13 +298,12 @@ class MultiOutputClassifier(MultiOutputEstimator, ClassifierMixin): estimator : estimator object An estimator object implementing `fit`, `score` and `predict_proba`. - n_jobs : int, optional, default=1 - The number of jobs to use for the computation. If -1 all CPUs are used. - If 1 is given, no parallel computing code is used at all, which is - useful for debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are - used. Thus for n_jobs = -2, all CPUs but one are used. + n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. It does each target variable in y in parallel. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- diff --git a/sklearn/neighbors/classification.py b/sklearn/neighbors/classification.py index e393e8acd2fa4..5c53fb7321732 100644 --- a/sklearn/neighbors/classification.py +++ b/sklearn/neighbors/classification.py @@ -75,9 +75,11 @@ class KNeighborsClassifier(NeighborsBase, KNeighborsMixin, metric_params : dict, optional (default = None) Additional keyword arguments for the metric function. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Doesn't affect :meth:`fit` method. Examples @@ -288,9 +290,11 @@ class RadiusNeighborsClassifier(NeighborsBase, RadiusNeighborsMixin, metric_params : dict, optional (default = None) Additional keyword arguments for the metric function. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Examples -------- diff --git a/sklearn/neighbors/graph.py b/sklearn/neighbors/graph.py index 3ca723ffac406..119947d1afb03 100644 --- a/sklearn/neighbors/graph.py +++ b/sklearn/neighbors/graph.py @@ -70,9 +70,11 @@ def kneighbors_graph(X, n_neighbors, mode='connectivity', metric='minkowski', itself. If `None`, then True is used for mode='connectivity' and False for mode='distance' as this will preserve backwards compatibility. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Returns ------- @@ -146,9 +148,11 @@ def radius_neighbors_graph(X, radius, mode='connectivity', metric='minkowski', itself. If `None`, then True is used for mode='connectivity' and False for mode='distance' as this will preserve backwards compatibility. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Returns ------- diff --git a/sklearn/neighbors/lof.py b/sklearn/neighbors/lof.py index da62857460a1a..436a2af7a9042 100644 --- a/sklearn/neighbors/lof.py +++ b/sklearn/neighbors/lof.py @@ -110,9 +110,11 @@ class LocalOutlierFactor(NeighborsBase, KNeighborsMixin, UnsupervisedMixin, that you should only use predict, decision_function and score_samples on new unseen data and not on the training set. - n_jobs : int, optional (default=1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Affects only :meth:`kneighbors` and :meth:`kneighbors_graph` methods. diff --git a/sklearn/neighbors/regression.py b/sklearn/neighbors/regression.py index be479fd84097b..e73058c26edb8 100644 --- a/sklearn/neighbors/regression.py +++ b/sklearn/neighbors/regression.py @@ -82,9 +82,11 @@ class KNeighborsRegressor(NeighborsBase, KNeighborsMixin, metric_params : dict, optional (default = None) Additional keyword arguments for the metric function. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Doesn't affect :meth:`fit` method. Examples @@ -238,9 +240,11 @@ class RadiusNeighborsRegressor(NeighborsBase, RadiusNeighborsMixin, metric_params : dict, optional (default = None) Additional keyword arguments for the metric function. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Examples -------- diff --git a/sklearn/neighbors/unsupervised.py b/sklearn/neighbors/unsupervised.py index d49cd9e950e13..8b67b3bab2d37 100644 --- a/sklearn/neighbors/unsupervised.py +++ b/sklearn/neighbors/unsupervised.py @@ -74,9 +74,11 @@ class NearestNeighbors(NeighborsBase, KNeighborsMixin, metric_params : dict, optional (default = None) Additional keyword arguments for the metric function. - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Examples -------- diff --git a/sklearn/pipeline.py b/sklearn/pipeline.py index 915c2daf9e1a6..eb811ee0b28d8 100644 --- a/sklearn/pipeline.py +++ b/sklearn/pipeline.py @@ -640,8 +640,11 @@ class FeatureUnion(_BaseComposition, TransformerMixin): List of transformer objects to be applied to the data. The first half of each tuple is the name of the transformer. - n_jobs : int, optional - Number of jobs to run in parallel (default 1). + n_jobs : int or None, optional (default=None) + Number of jobs to run in parallel. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. transformer_weights : dict, optional Multiplicative weights for features per transformer. @@ -844,8 +847,11 @@ def make_union(*transformers, **kwargs): ---------- *transformers : list of estimators - n_jobs : int, optional - Number of jobs to run in parallel (default 1). + n_jobs : int or None, optional (default=None) + Number of jobs to run in parallel. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Returns ------- diff --git a/sklearn/semi_supervised/label_propagation.py b/sklearn/semi_supervised/label_propagation.py index 2c3f1ac520c04..970d58944164a 100644 --- a/sklearn/semi_supervised/label_propagation.py +++ b/sklearn/semi_supervised/label_propagation.py @@ -101,9 +101,11 @@ class BaseLabelPropagation(six.with_metaclass(ABCMeta, BaseEstimator, Convergence tolerance: threshold to consider the system at steady state - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. """ def __init__(self, kernel='rbf', gamma=20, n_neighbors=7, @@ -334,9 +336,11 @@ class LabelPropagation(BaseLabelPropagation): Convergence tolerance: threshold to consider the system at steady state - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- @@ -452,9 +456,11 @@ class LabelSpreading(BaseLabelPropagation): Convergence tolerance: threshold to consider the system at steady state - n_jobs : int, optional (default = 1) + n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - If ``-1``, then the number of jobs is set to the number of CPU cores. + ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``-1`` means using all processors. See :term:`Glossary ` + for more details. Attributes ---------- From d4354703accff98e56390cf3fb1d056eb500a5d7 Mon Sep 17 00:00:00 2001 From: Hanmin Qin Date: Wed, 15 Aug 2018 20:49:38 +0800 Subject: [PATCH 3/9] flake8 --- sklearn/linear_model/coordinate_descent.py | 2 +- sklearn/multioutput.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sklearn/linear_model/coordinate_descent.py b/sklearn/linear_model/coordinate_descent.py index ad715060db30b..0ac637814147c 100644 --- a/sklearn/linear_model/coordinate_descent.py +++ b/sklearn/linear_model/coordinate_descent.py @@ -2019,7 +2019,7 @@ class MultiTaskElasticNetCV(LinearModelCV, RegressorMixin): Amount of verbosity. n_jobs : int or None, optional (default=None) - Number of CPUs to use during the cross validation. + Number of CPUs to use during the cross validation. ``None`` means 1 unless in a ``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/multioutput.py b/sklearn/multioutput.py index b9e7c498b90c6..e92d2a766e6c2 100644 --- a/sklearn/multioutput.py +++ b/sklearn/multioutput.py @@ -214,7 +214,7 @@ class MultiOutputRegressor(MultiOutputEstimator, RegressorMixin): ``None`` means 1 unless in a ``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. - + When individual estimators are fast to train or predict using `n_jobs>1` can result in slower performance due to the overhead of spawning processes. From 644391073017809f5798f620869c54520cbb1723 Mon Sep 17 00:00:00 2001 From: Hanmin Qin Date: Wed, 15 Aug 2018 21:40:53 +0800 Subject: [PATCH 4/9] add :obj: --- examples/model_selection/plot_learning_curve.py | 2 +- sklearn/cluster/bicluster.py | 4 ++-- sklearn/cluster/dbscan_.py | 4 ++-- sklearn/cluster/k_means_.py | 4 ++-- sklearn/cluster/mean_shift_.py | 6 +++--- sklearn/cluster/optics_.py | 4 ++-- sklearn/cluster/spectral.py | 2 +- sklearn/compose/_column_transformer.py | 4 ++-- sklearn/covariance/graph_lasso_.py | 4 ++-- sklearn/decomposition/dict_learning.py | 12 ++++++------ sklearn/decomposition/kernel_pca.py | 2 +- sklearn/decomposition/online_lda.py | 2 +- sklearn/decomposition/sparse_pca.py | 6 +++--- sklearn/ensemble/bagging.py | 4 ++-- sklearn/ensemble/forest.py | 10 +++++----- sklearn/ensemble/iforest.py | 2 +- sklearn/ensemble/partial_dependence.py | 2 +- sklearn/ensemble/voting_classifier.py | 2 +- sklearn/feature_selection/rfe.py | 2 +- sklearn/gaussian_process/gpc.py | 2 +- sklearn/linear_model/base.py | 2 +- sklearn/linear_model/coordinate_descent.py | 8 ++++---- sklearn/linear_model/least_angle.py | 4 ++-- sklearn/linear_model/logistic.py | 4 ++-- sklearn/linear_model/omp.py | 2 +- sklearn/linear_model/passive_aggressive.py | 2 +- sklearn/linear_model/perceptron.py | 2 +- sklearn/linear_model/randomized_l1.py | 6 +++--- sklearn/linear_model/stochastic_gradient.py | 2 +- sklearn/linear_model/theil_sen.py | 2 +- sklearn/manifold/isomap.py | 2 +- sklearn/manifold/locally_linear.py | 6 +++--- sklearn/manifold/mds.py | 4 ++-- sklearn/manifold/spectral_embedding_.py | 2 +- sklearn/metrics/pairwise.py | 6 +++--- sklearn/model_selection/_search.py | 4 ++-- sklearn/model_selection/_validation.py | 12 ++++++------ sklearn/multiclass.py | 6 +++--- sklearn/multioutput.py | 4 ++-- sklearn/neighbors/classification.py | 4 ++-- sklearn/neighbors/graph.py | 4 ++-- sklearn/neighbors/lof.py | 2 +- sklearn/neighbors/regression.py | 4 ++-- sklearn/neighbors/unsupervised.py | 2 +- sklearn/pipeline.py | 4 ++-- sklearn/semi_supervised/label_propagation.py | 6 +++--- 46 files changed, 93 insertions(+), 93 deletions(-) diff --git a/examples/model_selection/plot_learning_curve.py b/examples/model_selection/plot_learning_curve.py index 2d6b1d335ef7d..9cb09ef3d5b64 100644 --- a/examples/model_selection/plot_learning_curve.py +++ b/examples/model_selection/plot_learning_curve.py @@ -65,7 +65,7 @@ def plot_learning_curve(estimator, title, X, y, ylim=None, cv=None, n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/cluster/bicluster.py b/sklearn/cluster/bicluster.py index 8cb22837c9b7e..7e385b000dfc8 100644 --- a/sklearn/cluster/bicluster.py +++ b/sklearn/cluster/bicluster.py @@ -233,7 +233,7 @@ class SpectralCoclustering(BaseSpectral): down the pairwise matrix into n_jobs even slices and computing them in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -379,7 +379,7 @@ class SpectralBiclustering(BaseSpectral): down the pairwise matrix into n_jobs even slices and computing them in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/cluster/dbscan_.py b/sklearn/cluster/dbscan_.py index 4c109591dfcfa..950512934023f 100644 --- a/sklearn/cluster/dbscan_.py +++ b/sklearn/cluster/dbscan_.py @@ -78,7 +78,7 @@ def dbscan(X, eps=0.5, min_samples=5, metric='minkowski', metric_params=None, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -233,7 +233,7 @@ class DBSCAN(BaseEstimator, ClusterMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/cluster/k_means_.py b/sklearn/cluster/k_means_.py index cf7c114fec0c1..0c07516a3041b 100644 --- a/sklearn/cluster/k_means_.py +++ b/sklearn/cluster/k_means_.py @@ -265,7 +265,7 @@ def k_means(X, n_clusters, sample_weight=None, init='k-means++', The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -837,7 +837,7 @@ class KMeans(BaseEstimator, ClusterMixin, TransformerMixin): The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/cluster/mean_shift_.py b/sklearn/cluster/mean_shift_.py index cc362433c4dd6..792aff388f979 100644 --- a/sklearn/cluster/mean_shift_.py +++ b/sklearn/cluster/mean_shift_.py @@ -55,7 +55,7 @@ def estimate_bandwidth(X, quantile=0.3, n_samples=None, random_state=0, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -158,7 +158,7 @@ def mean_shift(X, bandwidth=None, seeds=None, bin_seeding=False, The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -339,7 +339,7 @@ class MeanShift(BaseEstimator, ClusterMixin): The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/cluster/optics_.py b/sklearn/cluster/optics_.py index bd7df5d367372..94e86cc58ca06 100755 --- a/sklearn/cluster/optics_.py +++ b/sklearn/cluster/optics_.py @@ -120,7 +120,7 @@ def optics(X, min_samples=5, max_bound=np.inf, metric='euclidean', n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -247,7 +247,7 @@ class OPTICS(BaseEstimator, ClusterMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/cluster/spectral.py b/sklearn/cluster/spectral.py index feb316ad483e4..3b809f5b372c2 100644 --- a/sklearn/cluster/spectral.py +++ b/sklearn/cluster/spectral.py @@ -360,7 +360,7 @@ class SpectralClustering(BaseEstimator, ClusterMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/compose/_column_transformer.py b/sklearn/compose/_column_transformer.py index cc35e358c4d0c..b2f10ed0209df 100644 --- a/sklearn/compose/_column_transformer.py +++ b/sklearn/compose/_column_transformer.py @@ -95,7 +95,7 @@ class ColumnTransformer(_BaseComposition, TransformerMixin): n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -671,7 +671,7 @@ def make_column_transformer(*transformers, **kwargs): n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/covariance/graph_lasso_.py b/sklearn/covariance/graph_lasso_.py index 01838b7972798..693567c2c1fb7 100644 --- a/sklearn/covariance/graph_lasso_.py +++ b/sklearn/covariance/graph_lasso_.py @@ -522,7 +522,7 @@ class GraphicalLassoCV(GraphicalLasso): n_jobs : int or None, optional (default=None) number of jobs to run in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -932,7 +932,7 @@ class GraphLassoCV(GraphicalLassoCV): n_jobs : int or None, optional (default=None) number of jobs to run in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/decomposition/dict_learning.py b/sklearn/decomposition/dict_learning.py index 29bf9ecb3e044..00937fcebd31a 100644 --- a/sklearn/decomposition/dict_learning.py +++ b/sklearn/decomposition/dict_learning.py @@ -248,7 +248,7 @@ def sparse_encode(X, dictionary, gram=None, cov=None, algorithm='lasso_lars', n_jobs : int or None, optional (default=None) Number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -464,7 +464,7 @@ def dict_learning(X, n_components, alpha, max_iter=100, tol=1e-8, n_jobs : int or None, optional (default=None) Number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -662,7 +662,7 @@ def dict_learning_online(X, n_components=2, alpha=1, n_iter=100, n_jobs : int or None, optional (default=None) Number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -960,7 +960,7 @@ class SparseCoder(BaseEstimator, SparseCodingMixin): n_jobs : int or None, optional (default=None) number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1083,7 +1083,7 @@ class DictionaryLearning(BaseEstimator, SparseCodingMixin): n_jobs : int or None, optional (default=None) number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1237,7 +1237,7 @@ class MiniBatchDictionaryLearning(BaseEstimator, SparseCodingMixin): n_jobs : int or None, optional (default=None) number of parallel jobs to run。 - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/decomposition/kernel_pca.py b/sklearn/decomposition/kernel_pca.py index 5a5dc31ba8e94..c6cdcc11213e8 100644 --- a/sklearn/decomposition/kernel_pca.py +++ b/sklearn/decomposition/kernel_pca.py @@ -91,7 +91,7 @@ class KernelPCA(BaseEstimator, TransformerMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/decomposition/online_lda.py b/sklearn/decomposition/online_lda.py index c106c34fb5354..bfb4326d46a8f 100644 --- a/sklearn/decomposition/online_lda.py +++ b/sklearn/decomposition/online_lda.py @@ -217,7 +217,7 @@ class LatentDirichletAllocation(BaseEstimator, TransformerMixin): n_jobs : int or None, optional (default=None) The number of jobs to use in the E-step. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/decomposition/sparse_pca.py b/sklearn/decomposition/sparse_pca.py index 43a607eaeea72..59a0893332c53 100644 --- a/sklearn/decomposition/sparse_pca.py +++ b/sklearn/decomposition/sparse_pca.py @@ -50,7 +50,7 @@ class SparsePCA(BaseEstimator, TransformerMixin): n_jobs : int or None, optional (default=None) Number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -273,8 +273,8 @@ class MiniBatchSparsePCA(SparsePCA): whether to shuffle the data before splitting it in batches n_jobs : int or None, optional (default=None) - number of parallel jobs to run。 - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + number of parallel jobs to run. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/ensemble/bagging.py b/sklearn/ensemble/bagging.py index 14184778629fb..8e1c7a1cae709 100644 --- a/sklearn/ensemble/bagging.py +++ b/sklearn/ensemble/bagging.py @@ -486,7 +486,7 @@ class BaggingClassifier(BaseBagging, ClassifierMixin): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -864,7 +864,7 @@ class BaggingRegressor(BaseBagging, RegressorMixin): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/ensemble/forest.py b/sklearn/ensemble/forest.py index a2ab75f44768e..5d0e9ec328e4c 100644 --- a/sklearn/ensemble/forest.py +++ b/sklearn/ensemble/forest.py @@ -865,7 +865,7 @@ class RandomForestClassifier(ForestClassifier): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1150,7 +1150,7 @@ class RandomForestRegressor(ForestRegressor): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - `None`` means 1 unless in a ``joblib.parallel_backend`` context. + `None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1388,7 +1388,7 @@ class ExtraTreesClassifier(ForestClassifier): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1643,7 +1643,7 @@ class ExtraTreesRegressor(ForestRegressor): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1837,7 +1837,7 @@ class RandomTreesEmbedding(BaseForest): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/ensemble/iforest.py b/sklearn/ensemble/iforest.py index 1bd59542f8458..09eb3bbdb4256 100644 --- a/sklearn/ensemble/iforest.py +++ b/sklearn/ensemble/iforest.py @@ -87,7 +87,7 @@ class IsolationForest(BaseBagging, OutlierMixin): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/ensemble/partial_dependence.py b/sklearn/ensemble/partial_dependence.py index 72818e83512bb..de166a069378a 100644 --- a/sklearn/ensemble/partial_dependence.py +++ b/sklearn/ensemble/partial_dependence.py @@ -204,7 +204,7 @@ def plot_partial_dependence(gbrt, X, features, feature_names=None, The lower and upper percentile used to create the extreme values for the PDP axes. n_jobs : int or None, optional (default=None) - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. verbose : int diff --git a/sklearn/ensemble/voting_classifier.py b/sklearn/ensemble/voting_classifier.py index 0554ab6edfea0..29ee8878be808 100644 --- a/sklearn/ensemble/voting_classifier.py +++ b/sklearn/ensemble/voting_classifier.py @@ -61,7 +61,7 @@ class VotingClassifier(_BaseComposition, ClassifierMixin, TransformerMixin): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for ``fit``. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/feature_selection/rfe.py b/sklearn/feature_selection/rfe.py index 534f1b33b1cfa..bffd12f0d0c6a 100644 --- a/sklearn/feature_selection/rfe.py +++ b/sklearn/feature_selection/rfe.py @@ -379,7 +379,7 @@ class RFECV(RFE, MetaEstimatorMixin): n_jobs : int or None, optional (default=None) Number of cores to run in parallel while fitting across folds. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/gaussian_process/gpc.py b/sklearn/gaussian_process/gpc.py index 2a74248c274f4..e7e222146417e 100644 --- a/sklearn/gaussian_process/gpc.py +++ b/sklearn/gaussian_process/gpc.py @@ -536,7 +536,7 @@ def optimizer(obj_func, initial_theta, bounds): n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/base.py b/sklearn/linear_model/base.py index d75ed6ded4497..bd7c579fab921 100644 --- a/sklearn/linear_model/base.py +++ b/sklearn/linear_model/base.py @@ -383,7 +383,7 @@ class LinearRegression(LinearModel, RegressorMixin): n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/coordinate_descent.py b/sklearn/linear_model/coordinate_descent.py index 0ac637814147c..806aeb6decc39 100644 --- a/sklearn/linear_model/coordinate_descent.py +++ b/sklearn/linear_model/coordinate_descent.py @@ -1322,7 +1322,7 @@ class LassoCV(LinearModelCV, RegressorMixin): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1484,7 +1484,7 @@ class ElasticNetCV(LinearModelCV, RegressorMixin): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -2020,7 +2020,7 @@ class MultiTaskElasticNetCV(LinearModelCV, RegressorMixin): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -2193,7 +2193,7 @@ class MultiTaskLassoCV(LinearModelCV, RegressorMixin): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/least_angle.py b/sklearn/linear_model/least_angle.py index ab7e7c7a45397..ab78c06844eae 100644 --- a/sklearn/linear_model/least_angle.py +++ b/sklearn/linear_model/least_angle.py @@ -1024,7 +1024,7 @@ class LarsCV(Lars): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1239,7 +1239,7 @@ class LassoLarsCV(LarsCV): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py index 4e72d983b21fc..2d3d2e5113f41 100644 --- a/sklearn/linear_model/logistic.py +++ b/sklearn/linear_model/logistic.py @@ -1097,7 +1097,7 @@ class LogisticRegression(BaseEstimator, LinearClassifierMixin, Number of CPU cores used when parallelizing over classes if multi_class='ovr'". This parameter is ignored when the ``solver`` is set to 'liblinear' regardless of whether 'multi_class' is specified or - not. ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + not. ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1499,7 +1499,7 @@ class LogisticRegressionCV(LogisticRegression, BaseEstimator, n_jobs : int or None, optional (default=None) Number of CPU cores used during the cross-validation loop. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/omp.py b/sklearn/linear_model/omp.py index 35f1baecc46e1..22a349a131568 100644 --- a/sklearn/linear_model/omp.py +++ b/sklearn/linear_model/omp.py @@ -791,7 +791,7 @@ class OrthogonalMatchingPursuitCV(LinearModel, RegressorMixin): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/passive_aggressive.py b/sklearn/linear_model/passive_aggressive.py index c2012707e21ee..32600f55cabca 100644 --- a/sklearn/linear_model/passive_aggressive.py +++ b/sklearn/linear_model/passive_aggressive.py @@ -71,7 +71,7 @@ class PassiveAggressiveClassifier(BaseSGDClassifier): n_jobs : int or None, optional (default=None) The number of CPUs to use to do the OVA (One Versus All, for multi-class problems) computation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/perceptron.py b/sklearn/linear_model/perceptron.py index dc72145fcb848..ff7a20f5ced07 100644 --- a/sklearn/linear_model/perceptron.py +++ b/sklearn/linear_model/perceptron.py @@ -50,7 +50,7 @@ class Perceptron(BaseSGDClassifier): n_jobs : int or None, optional (default=None) The number of CPUs to use to do the OVA (One Versus All, for multi-class problems) computation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/randomized_l1.py b/sklearn/linear_model/randomized_l1.py index fc746d9487235..ffde1d9a7ccd1 100644 --- a/sklearn/linear_model/randomized_l1.py +++ b/sklearn/linear_model/randomized_l1.py @@ -259,7 +259,7 @@ class RandomizedLasso(BaseRandomizedLinearModel): n_jobs : int or None, optional (default=None) Number of CPUs to use during the resampling. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -455,7 +455,7 @@ class RandomizedLogisticRegression(BaseRandomizedLinearModel): n_jobs : int or None, optional (default=None) Number of CPUs to use during the resampling. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -614,7 +614,7 @@ def lasso_stability_path(X, y, scaling=0.5, random_state=None, n_jobs : int or None, optional (default=None) Number of CPUs to use during the resampling. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/stochastic_gradient.py b/sklearn/linear_model/stochastic_gradient.py index fe8e726324c6d..4fa69629ccf8f 100644 --- a/sklearn/linear_model/stochastic_gradient.py +++ b/sklearn/linear_model/stochastic_gradient.py @@ -809,7 +809,7 @@ class SGDClassifier(BaseSGDClassifier): n_jobs : int or None, optional (default=None) The number of CPUs to use to do the OVA (One Versus All, for multi-class problems) computation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/theil_sen.py b/sklearn/linear_model/theil_sen.py index e84647a2fafc6..16f7aa72fdc1d 100644 --- a/sklearn/linear_model/theil_sen.py +++ b/sklearn/linear_model/theil_sen.py @@ -251,7 +251,7 @@ class TheilSenRegressor(LinearModel, RegressorMixin): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/manifold/isomap.py b/sklearn/manifold/isomap.py index c270dcc0bf75a..d6626e8a9331e 100644 --- a/sklearn/manifold/isomap.py +++ b/sklearn/manifold/isomap.py @@ -60,7 +60,7 @@ class Isomap(BaseEstimator, TransformerMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/manifold/locally_linear.py b/sklearn/manifold/locally_linear.py index ae8eea82ee2d7..21ba19be32fe4 100644 --- a/sklearn/manifold/locally_linear.py +++ b/sklearn/manifold/locally_linear.py @@ -83,7 +83,7 @@ def barycenter_kneighbors_graph(X, n_neighbors, reg=1e-3, n_jobs=None): n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -257,7 +257,7 @@ def locally_linear_embedding( n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -588,7 +588,7 @@ class LocallyLinearEmbedding(BaseEstimator, TransformerMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/manifold/mds.py b/sklearn/manifold/mds.py index 3154f1fea361c..68b49a840e282 100644 --- a/sklearn/manifold/mds.py +++ b/sklearn/manifold/mds.py @@ -183,7 +183,7 @@ def smacof(dissimilarities, metric=True, n_components=2, init=None, n_init=8, initializations are used (``n_init``), each run of the algorithm is computed in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -309,7 +309,7 @@ class MDS(BaseEstimator): initializations are used (``n_init``), each run of the algorithm is computed in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/manifold/spectral_embedding_.py b/sklearn/manifold/spectral_embedding_.py index a1ee199fd521f..22bd1c73b8e13 100644 --- a/sklearn/manifold/spectral_embedding_.py +++ b/sklearn/manifold/spectral_embedding_.py @@ -384,7 +384,7 @@ class SpectralEmbedding(BaseEstimator): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/metrics/pairwise.py b/sklearn/metrics/pairwise.py index 44b682e1a56df..64f89a0ec1dfb 100644 --- a/sklearn/metrics/pairwise.py +++ b/sklearn/metrics/pairwise.py @@ -1186,7 +1186,7 @@ def pairwise_distances_chunked(X, Y=None, reduce_func=None, down the pairwise matrix into n_jobs even slices and computing them in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1348,7 +1348,7 @@ def pairwise_distances(X, Y=None, metric="euclidean", n_jobs=None, **kwds): down the pairwise matrix into n_jobs even slices and computing them in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1518,7 +1518,7 @@ def pairwise_kernels(X, Y=None, metric="linear", filter_params=False, down the pairwise matrix into n_jobs even slices and computing them in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/model_selection/_search.py b/sklearn/model_selection/_search.py index 19b3f8c3bf71a..e32f973e54c99 100644 --- a/sklearn/model_selection/_search.py +++ b/sklearn/model_selection/_search.py @@ -905,7 +905,7 @@ class GridSearchCV(BaseSearchCV): n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1252,7 +1252,7 @@ class RandomizedSearchCV(BaseSearchCV): n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index 28fc3e6ef844e..205337531b00d 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -99,7 +99,7 @@ def cross_validate(estimator, X, y=None, groups=None, scoring=None, cv='warn', n_jobs : int or None, optional (default=None) The number of CPUs to use to do the computation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -323,7 +323,7 @@ def cross_val_score(estimator, X, y=None, groups=None, scoring=None, cv='warn', n_jobs : int or None, optional (default=None) The number of CPUs to use to do the computation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -698,7 +698,7 @@ def cross_val_predict(estimator, X, y=None, groups=None, cv='warn', n_jobs : int or None, optional (default=None) The number of CPUs to use to do the computation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -992,7 +992,7 @@ def permutation_test_score(estimator, X, y, groups=None, cv='warn', n_jobs : int or None, optional (default=None) The number of CPUs to use to do the computation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1150,7 +1150,7 @@ def learning_curve(estimator, X, y, groups=None, n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1397,7 +1397,7 @@ def validation_curve(estimator, X, y, param_name, param_range, groups=None, n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/multiclass.py b/sklearn/multiclass.py index 588a46ed1b443..915210a5baa44 100644 --- a/sklearn/multiclass.py +++ b/sklearn/multiclass.py @@ -159,7 +159,7 @@ class OneVsRestClassifier(BaseEstimator, ClassifierMixin, MetaEstimatorMixin): n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -458,7 +458,7 @@ class OneVsOneClassifier(BaseEstimator, ClassifierMixin, MetaEstimatorMixin): n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -664,7 +664,7 @@ class OutputCodeClassifier(BaseEstimator, ClassifierMixin, MetaEstimatorMixin): n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/multioutput.py b/sklearn/multioutput.py index e92d2a766e6c2..a5da7ff278e67 100644 --- a/sklearn/multioutput.py +++ b/sklearn/multioutput.py @@ -211,7 +211,7 @@ class MultiOutputRegressor(MultiOutputEstimator, RegressorMixin): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for `fit`. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -301,7 +301,7 @@ class MultiOutputClassifier(MultiOutputEstimator, ClassifierMixin): n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. It does each target variable in y in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/neighbors/classification.py b/sklearn/neighbors/classification.py index 5c53fb7321732..dc44ff5b4e4c8 100644 --- a/sklearn/neighbors/classification.py +++ b/sklearn/neighbors/classification.py @@ -77,7 +77,7 @@ class KNeighborsClassifier(NeighborsBase, KNeighborsMixin, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. Doesn't affect :meth:`fit` method. @@ -292,7 +292,7 @@ class RadiusNeighborsClassifier(NeighborsBase, RadiusNeighborsMixin, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/neighbors/graph.py b/sklearn/neighbors/graph.py index 119947d1afb03..4c29c2feacecb 100644 --- a/sklearn/neighbors/graph.py +++ b/sklearn/neighbors/graph.py @@ -72,7 +72,7 @@ def kneighbors_graph(X, n_neighbors, mode='connectivity', metric='minkowski', n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -150,7 +150,7 @@ def radius_neighbors_graph(X, radius, mode='connectivity', metric='minkowski', n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/neighbors/lof.py b/sklearn/neighbors/lof.py index 436a2af7a9042..b580a828c4c75 100644 --- a/sklearn/neighbors/lof.py +++ b/sklearn/neighbors/lof.py @@ -112,7 +112,7 @@ class LocalOutlierFactor(NeighborsBase, KNeighborsMixin, UnsupervisedMixin, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. Affects only :meth:`kneighbors` and :meth:`kneighbors_graph` methods. diff --git a/sklearn/neighbors/regression.py b/sklearn/neighbors/regression.py index e73058c26edb8..bead64c78443f 100644 --- a/sklearn/neighbors/regression.py +++ b/sklearn/neighbors/regression.py @@ -84,7 +84,7 @@ class KNeighborsRegressor(NeighborsBase, KNeighborsMixin, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. Doesn't affect :meth:`fit` method. @@ -242,7 +242,7 @@ class RadiusNeighborsRegressor(NeighborsBase, RadiusNeighborsMixin, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/neighbors/unsupervised.py b/sklearn/neighbors/unsupervised.py index 8b67b3bab2d37..f3e749b7ed04c 100644 --- a/sklearn/neighbors/unsupervised.py +++ b/sklearn/neighbors/unsupervised.py @@ -76,7 +76,7 @@ class NearestNeighbors(NeighborsBase, KNeighborsMixin, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/pipeline.py b/sklearn/pipeline.py index eb811ee0b28d8..f4e1ebacadb67 100644 --- a/sklearn/pipeline.py +++ b/sklearn/pipeline.py @@ -642,7 +642,7 @@ class FeatureUnion(_BaseComposition, TransformerMixin): n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -849,7 +849,7 @@ def make_union(*transformers, **kwargs): n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/semi_supervised/label_propagation.py b/sklearn/semi_supervised/label_propagation.py index 970d58944164a..05d547ea9d037 100644 --- a/sklearn/semi_supervised/label_propagation.py +++ b/sklearn/semi_supervised/label_propagation.py @@ -103,7 +103,7 @@ class BaseLabelPropagation(six.with_metaclass(ABCMeta, BaseEstimator, n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. """ @@ -338,7 +338,7 @@ class LabelPropagation(BaseLabelPropagation): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -458,7 +458,7 @@ class LabelSpreading(BaseLabelPropagation): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a ``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. From d21ff9f4ec61c67fd286f3b8cf8c23f7a7df1b8e Mon Sep 17 00:00:00 2001 From: Hanmin Qin Date: Wed, 15 Aug 2018 21:51:57 +0800 Subject: [PATCH 5/9] stupid mistakes --- sklearn/decomposition/dict_learning.py | 2 +- sklearn/linear_model/logistic.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sklearn/decomposition/dict_learning.py b/sklearn/decomposition/dict_learning.py index 00937fcebd31a..b75d828b2804c 100644 --- a/sklearn/decomposition/dict_learning.py +++ b/sklearn/decomposition/dict_learning.py @@ -1236,7 +1236,7 @@ class MiniBatchDictionaryLearning(BaseEstimator, SparseCodingMixin): the estimated components are sparse. n_jobs : int or None, optional (default=None) - number of parallel jobs to run。 + number of parallel jobs to run. ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py index 2d3d2e5113f41..daeca482a8f59 100644 --- a/sklearn/linear_model/logistic.py +++ b/sklearn/linear_model/logistic.py @@ -1097,9 +1097,9 @@ class LogisticRegression(BaseEstimator, LinearClassifierMixin, Number of CPU cores used when parallelizing over classes if multi_class='ovr'". This parameter is ignored when the ``solver`` is set to 'liblinear' regardless of whether 'multi_class' is specified or - not. ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. - ``-1`` means using all processors. See :term:`Glossary ` - for more details. + not. ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` + context. ``-1`` means using all processors. + See :term:`Glossary ` for more details. Attributes ---------- From 4454dca72df42169f81151f2e95ddb9b97b49e2a Mon Sep 17 00:00:00 2001 From: Hanmin Qin Date: Wed, 15 Aug 2018 22:21:13 +0800 Subject: [PATCH 6/9] format --- examples/model_selection/plot_learning_curve.py | 2 +- sklearn/cluster/bicluster.py | 4 ++-- sklearn/cluster/dbscan_.py | 4 ++-- sklearn/cluster/k_means_.py | 4 ++-- sklearn/cluster/mean_shift_.py | 6 +++--- sklearn/cluster/optics_.py | 4 ++-- sklearn/cluster/spectral.py | 2 +- sklearn/compose/_column_transformer.py | 4 ++-- sklearn/covariance/graph_lasso_.py | 4 ++-- sklearn/decomposition/dict_learning.py | 12 ++++++------ sklearn/decomposition/kernel_pca.py | 2 +- sklearn/decomposition/online_lda.py | 2 +- sklearn/decomposition/sparse_pca.py | 4 ++-- sklearn/ensemble/bagging.py | 4 ++-- sklearn/ensemble/forest.py | 10 +++++----- sklearn/ensemble/iforest.py | 2 +- sklearn/ensemble/partial_dependence.py | 2 +- sklearn/ensemble/voting_classifier.py | 2 +- sklearn/feature_selection/rfe.py | 2 +- sklearn/gaussian_process/gpc.py | 2 +- sklearn/linear_model/base.py | 2 +- sklearn/linear_model/coordinate_descent.py | 8 ++++---- sklearn/linear_model/least_angle.py | 4 ++-- sklearn/linear_model/logistic.py | 4 ++-- sklearn/linear_model/omp.py | 2 +- sklearn/linear_model/passive_aggressive.py | 2 +- sklearn/linear_model/perceptron.py | 2 +- sklearn/linear_model/randomized_l1.py | 6 +++--- sklearn/linear_model/stochastic_gradient.py | 2 +- sklearn/linear_model/theil_sen.py | 2 +- sklearn/manifold/isomap.py | 2 +- sklearn/manifold/locally_linear.py | 6 +++--- sklearn/manifold/mds.py | 4 ++-- sklearn/manifold/spectral_embedding_.py | 2 +- sklearn/metrics/pairwise.py | 6 +++--- sklearn/model_selection/_search.py | 4 ++-- sklearn/model_selection/_validation.py | 12 ++++++------ sklearn/multiclass.py | 6 +++--- sklearn/multioutput.py | 4 ++-- sklearn/neighbors/classification.py | 4 ++-- sklearn/neighbors/graph.py | 4 ++-- sklearn/neighbors/lof.py | 2 +- sklearn/neighbors/regression.py | 4 ++-- sklearn/neighbors/unsupervised.py | 2 +- sklearn/pipeline.py | 4 ++-- sklearn/semi_supervised/label_propagation.py | 6 +++--- 46 files changed, 92 insertions(+), 92 deletions(-) diff --git a/examples/model_selection/plot_learning_curve.py b/examples/model_selection/plot_learning_curve.py index 9cb09ef3d5b64..4d86c323f53b4 100644 --- a/examples/model_selection/plot_learning_curve.py +++ b/examples/model_selection/plot_learning_curve.py @@ -65,7 +65,7 @@ def plot_learning_curve(estimator, title, X, y, ylim=None, cv=None, n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/cluster/bicluster.py b/sklearn/cluster/bicluster.py index 7e385b000dfc8..8bbf7353129a4 100644 --- a/sklearn/cluster/bicluster.py +++ b/sklearn/cluster/bicluster.py @@ -233,7 +233,7 @@ class SpectralCoclustering(BaseSpectral): down the pairwise matrix into n_jobs even slices and computing them in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -379,7 +379,7 @@ class SpectralBiclustering(BaseSpectral): down the pairwise matrix into n_jobs even slices and computing them in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/cluster/dbscan_.py b/sklearn/cluster/dbscan_.py index 950512934023f..f10890e10f2c8 100644 --- a/sklearn/cluster/dbscan_.py +++ b/sklearn/cluster/dbscan_.py @@ -78,7 +78,7 @@ def dbscan(X, eps=0.5, min_samples=5, metric='minkowski', metric_params=None, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -233,7 +233,7 @@ class DBSCAN(BaseEstimator, ClusterMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/cluster/k_means_.py b/sklearn/cluster/k_means_.py index 0c07516a3041b..c402bf6c8b615 100644 --- a/sklearn/cluster/k_means_.py +++ b/sklearn/cluster/k_means_.py @@ -265,7 +265,7 @@ def k_means(X, n_clusters, sample_weight=None, init='k-means++', The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -837,7 +837,7 @@ class KMeans(BaseEstimator, ClusterMixin, TransformerMixin): The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/cluster/mean_shift_.py b/sklearn/cluster/mean_shift_.py index 792aff388f979..487545ac039d3 100644 --- a/sklearn/cluster/mean_shift_.py +++ b/sklearn/cluster/mean_shift_.py @@ -55,7 +55,7 @@ def estimate_bandwidth(X, quantile=0.3, n_samples=None, random_state=0, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -158,7 +158,7 @@ def mean_shift(X, bandwidth=None, seeds=None, bin_seeding=False, The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -339,7 +339,7 @@ class MeanShift(BaseEstimator, ClusterMixin): The number of jobs to use for the computation. This works by computing each of the n_init runs in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/cluster/optics_.py b/sklearn/cluster/optics_.py index 94e86cc58ca06..e10a92a7590e6 100755 --- a/sklearn/cluster/optics_.py +++ b/sklearn/cluster/optics_.py @@ -120,7 +120,7 @@ def optics(X, min_samples=5, max_bound=np.inf, metric='euclidean', n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -247,7 +247,7 @@ class OPTICS(BaseEstimator, ClusterMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/cluster/spectral.py b/sklearn/cluster/spectral.py index 3b809f5b372c2..31a2046dbf0ec 100644 --- a/sklearn/cluster/spectral.py +++ b/sklearn/cluster/spectral.py @@ -360,7 +360,7 @@ class SpectralClustering(BaseEstimator, ClusterMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/compose/_column_transformer.py b/sklearn/compose/_column_transformer.py index b2f10ed0209df..e09d2d09d7e43 100644 --- a/sklearn/compose/_column_transformer.py +++ b/sklearn/compose/_column_transformer.py @@ -95,7 +95,7 @@ class ColumnTransformer(_BaseComposition, TransformerMixin): n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -671,7 +671,7 @@ def make_column_transformer(*transformers, **kwargs): n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/covariance/graph_lasso_.py b/sklearn/covariance/graph_lasso_.py index 693567c2c1fb7..b10e3c7f3f828 100644 --- a/sklearn/covariance/graph_lasso_.py +++ b/sklearn/covariance/graph_lasso_.py @@ -522,7 +522,7 @@ class GraphicalLassoCV(GraphicalLasso): n_jobs : int or None, optional (default=None) number of jobs to run in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -932,7 +932,7 @@ class GraphLassoCV(GraphicalLassoCV): n_jobs : int or None, optional (default=None) number of jobs to run in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/decomposition/dict_learning.py b/sklearn/decomposition/dict_learning.py index b75d828b2804c..b810f98e080ec 100644 --- a/sklearn/decomposition/dict_learning.py +++ b/sklearn/decomposition/dict_learning.py @@ -248,7 +248,7 @@ def sparse_encode(X, dictionary, gram=None, cov=None, algorithm='lasso_lars', n_jobs : int or None, optional (default=None) Number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -464,7 +464,7 @@ def dict_learning(X, n_components, alpha, max_iter=100, tol=1e-8, n_jobs : int or None, optional (default=None) Number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -662,7 +662,7 @@ def dict_learning_online(X, n_components=2, alpha=1, n_iter=100, n_jobs : int or None, optional (default=None) Number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -960,7 +960,7 @@ class SparseCoder(BaseEstimator, SparseCodingMixin): n_jobs : int or None, optional (default=None) number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1083,7 +1083,7 @@ class DictionaryLearning(BaseEstimator, SparseCodingMixin): n_jobs : int or None, optional (default=None) number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1237,7 +1237,7 @@ class MiniBatchDictionaryLearning(BaseEstimator, SparseCodingMixin): n_jobs : int or None, optional (default=None) number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/decomposition/kernel_pca.py b/sklearn/decomposition/kernel_pca.py index c6cdcc11213e8..7d222b85543ce 100644 --- a/sklearn/decomposition/kernel_pca.py +++ b/sklearn/decomposition/kernel_pca.py @@ -91,7 +91,7 @@ class KernelPCA(BaseEstimator, TransformerMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/decomposition/online_lda.py b/sklearn/decomposition/online_lda.py index bfb4326d46a8f..d143eed6050ee 100644 --- a/sklearn/decomposition/online_lda.py +++ b/sklearn/decomposition/online_lda.py @@ -217,7 +217,7 @@ class LatentDirichletAllocation(BaseEstimator, TransformerMixin): n_jobs : int or None, optional (default=None) The number of jobs to use in the E-step. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/decomposition/sparse_pca.py b/sklearn/decomposition/sparse_pca.py index 59a0893332c53..d676790a0d9e0 100644 --- a/sklearn/decomposition/sparse_pca.py +++ b/sklearn/decomposition/sparse_pca.py @@ -50,7 +50,7 @@ class SparsePCA(BaseEstimator, TransformerMixin): n_jobs : int or None, optional (default=None) Number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -274,7 +274,7 @@ class MiniBatchSparsePCA(SparsePCA): n_jobs : int or None, optional (default=None) number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/ensemble/bagging.py b/sklearn/ensemble/bagging.py index 8e1c7a1cae709..51dce324a0013 100644 --- a/sklearn/ensemble/bagging.py +++ b/sklearn/ensemble/bagging.py @@ -486,7 +486,7 @@ class BaggingClassifier(BaseBagging, ClassifierMixin): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -864,7 +864,7 @@ class BaggingRegressor(BaseBagging, RegressorMixin): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/ensemble/forest.py b/sklearn/ensemble/forest.py index 5d0e9ec328e4c..0f517166d202f 100644 --- a/sklearn/ensemble/forest.py +++ b/sklearn/ensemble/forest.py @@ -865,7 +865,7 @@ class RandomForestClassifier(ForestClassifier): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1150,7 +1150,7 @@ class RandomForestRegressor(ForestRegressor): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - `None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + `None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1388,7 +1388,7 @@ class ExtraTreesClassifier(ForestClassifier): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1643,7 +1643,7 @@ class ExtraTreesRegressor(ForestRegressor): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1837,7 +1837,7 @@ class RandomTreesEmbedding(BaseForest): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/ensemble/iforest.py b/sklearn/ensemble/iforest.py index 09eb3bbdb4256..66beeadb53de4 100644 --- a/sklearn/ensemble/iforest.py +++ b/sklearn/ensemble/iforest.py @@ -87,7 +87,7 @@ class IsolationForest(BaseBagging, OutlierMixin): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for both `fit` and `predict`. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/ensemble/partial_dependence.py b/sklearn/ensemble/partial_dependence.py index de166a069378a..f8d5ca7f240a0 100644 --- a/sklearn/ensemble/partial_dependence.py +++ b/sklearn/ensemble/partial_dependence.py @@ -204,7 +204,7 @@ def plot_partial_dependence(gbrt, X, features, feature_names=None, The lower and upper percentile used to create the extreme values for the PDP axes. n_jobs : int or None, optional (default=None) - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. verbose : int diff --git a/sklearn/ensemble/voting_classifier.py b/sklearn/ensemble/voting_classifier.py index 29ee8878be808..f624df1c664fb 100644 --- a/sklearn/ensemble/voting_classifier.py +++ b/sklearn/ensemble/voting_classifier.py @@ -61,7 +61,7 @@ class VotingClassifier(_BaseComposition, ClassifierMixin, TransformerMixin): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for ``fit``. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/feature_selection/rfe.py b/sklearn/feature_selection/rfe.py index bffd12f0d0c6a..6aa4c101747e1 100644 --- a/sklearn/feature_selection/rfe.py +++ b/sklearn/feature_selection/rfe.py @@ -379,7 +379,7 @@ class RFECV(RFE, MetaEstimatorMixin): n_jobs : int or None, optional (default=None) Number of cores to run in parallel while fitting across folds. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/gaussian_process/gpc.py b/sklearn/gaussian_process/gpc.py index e7e222146417e..95288e7dc711e 100644 --- a/sklearn/gaussian_process/gpc.py +++ b/sklearn/gaussian_process/gpc.py @@ -536,7 +536,7 @@ def optimizer(obj_func, initial_theta, bounds): n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/base.py b/sklearn/linear_model/base.py index bd7c579fab921..83d2aa27599fd 100644 --- a/sklearn/linear_model/base.py +++ b/sklearn/linear_model/base.py @@ -383,7 +383,7 @@ class LinearRegression(LinearModel, RegressorMixin): n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/coordinate_descent.py b/sklearn/linear_model/coordinate_descent.py index 806aeb6decc39..b9b5654cf9625 100644 --- a/sklearn/linear_model/coordinate_descent.py +++ b/sklearn/linear_model/coordinate_descent.py @@ -1322,7 +1322,7 @@ class LassoCV(LinearModelCV, RegressorMixin): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1484,7 +1484,7 @@ class ElasticNetCV(LinearModelCV, RegressorMixin): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -2020,7 +2020,7 @@ class MultiTaskElasticNetCV(LinearModelCV, RegressorMixin): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -2193,7 +2193,7 @@ class MultiTaskLassoCV(LinearModelCV, RegressorMixin): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/least_angle.py b/sklearn/linear_model/least_angle.py index ab78c06844eae..d139560260a87 100644 --- a/sklearn/linear_model/least_angle.py +++ b/sklearn/linear_model/least_angle.py @@ -1024,7 +1024,7 @@ class LarsCV(Lars): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1239,7 +1239,7 @@ class LassoLarsCV(LarsCV): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py index daeca482a8f59..85a531dacf3d8 100644 --- a/sklearn/linear_model/logistic.py +++ b/sklearn/linear_model/logistic.py @@ -1097,7 +1097,7 @@ class LogisticRegression(BaseEstimator, LinearClassifierMixin, Number of CPU cores used when parallelizing over classes if multi_class='ovr'". This parameter is ignored when the ``solver`` is set to 'liblinear' regardless of whether 'multi_class' is specified or - not. ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` + not. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1499,7 +1499,7 @@ class LogisticRegressionCV(LogisticRegression, BaseEstimator, n_jobs : int or None, optional (default=None) Number of CPU cores used during the cross-validation loop. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/omp.py b/sklearn/linear_model/omp.py index 22a349a131568..a0f6d49490948 100644 --- a/sklearn/linear_model/omp.py +++ b/sklearn/linear_model/omp.py @@ -791,7 +791,7 @@ class OrthogonalMatchingPursuitCV(LinearModel, RegressorMixin): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/passive_aggressive.py b/sklearn/linear_model/passive_aggressive.py index 32600f55cabca..22f1c0fbba121 100644 --- a/sklearn/linear_model/passive_aggressive.py +++ b/sklearn/linear_model/passive_aggressive.py @@ -71,7 +71,7 @@ class PassiveAggressiveClassifier(BaseSGDClassifier): n_jobs : int or None, optional (default=None) The number of CPUs to use to do the OVA (One Versus All, for multi-class problems) computation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/perceptron.py b/sklearn/linear_model/perceptron.py index ff7a20f5ced07..086e182e4eed8 100644 --- a/sklearn/linear_model/perceptron.py +++ b/sklearn/linear_model/perceptron.py @@ -50,7 +50,7 @@ class Perceptron(BaseSGDClassifier): n_jobs : int or None, optional (default=None) The number of CPUs to use to do the OVA (One Versus All, for multi-class problems) computation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/randomized_l1.py b/sklearn/linear_model/randomized_l1.py index ffde1d9a7ccd1..cc87276964a88 100644 --- a/sklearn/linear_model/randomized_l1.py +++ b/sklearn/linear_model/randomized_l1.py @@ -259,7 +259,7 @@ class RandomizedLasso(BaseRandomizedLinearModel): n_jobs : int or None, optional (default=None) Number of CPUs to use during the resampling. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -455,7 +455,7 @@ class RandomizedLogisticRegression(BaseRandomizedLinearModel): n_jobs : int or None, optional (default=None) Number of CPUs to use during the resampling. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -614,7 +614,7 @@ def lasso_stability_path(X, y, scaling=0.5, random_state=None, n_jobs : int or None, optional (default=None) Number of CPUs to use during the resampling. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/stochastic_gradient.py b/sklearn/linear_model/stochastic_gradient.py index 4fa69629ccf8f..93a2a6c912094 100644 --- a/sklearn/linear_model/stochastic_gradient.py +++ b/sklearn/linear_model/stochastic_gradient.py @@ -809,7 +809,7 @@ class SGDClassifier(BaseSGDClassifier): n_jobs : int or None, optional (default=None) The number of CPUs to use to do the OVA (One Versus All, for multi-class problems) computation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/theil_sen.py b/sklearn/linear_model/theil_sen.py index 16f7aa72fdc1d..0f3b19164b146 100644 --- a/sklearn/linear_model/theil_sen.py +++ b/sklearn/linear_model/theil_sen.py @@ -251,7 +251,7 @@ class TheilSenRegressor(LinearModel, RegressorMixin): n_jobs : int or None, optional (default=None) Number of CPUs to use during the cross validation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/manifold/isomap.py b/sklearn/manifold/isomap.py index d6626e8a9331e..aa0b477a9ca97 100644 --- a/sklearn/manifold/isomap.py +++ b/sklearn/manifold/isomap.py @@ -60,7 +60,7 @@ class Isomap(BaseEstimator, TransformerMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/manifold/locally_linear.py b/sklearn/manifold/locally_linear.py index 21ba19be32fe4..4e1a70a7b6f07 100644 --- a/sklearn/manifold/locally_linear.py +++ b/sklearn/manifold/locally_linear.py @@ -83,7 +83,7 @@ def barycenter_kneighbors_graph(X, n_neighbors, reg=1e-3, n_jobs=None): n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -257,7 +257,7 @@ def locally_linear_embedding( n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -588,7 +588,7 @@ class LocallyLinearEmbedding(BaseEstimator, TransformerMixin): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/manifold/mds.py b/sklearn/manifold/mds.py index 68b49a840e282..cdcc58ec97d4b 100644 --- a/sklearn/manifold/mds.py +++ b/sklearn/manifold/mds.py @@ -183,7 +183,7 @@ def smacof(dissimilarities, metric=True, n_components=2, init=None, n_init=8, initializations are used (``n_init``), each run of the algorithm is computed in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -309,7 +309,7 @@ class MDS(BaseEstimator): initializations are used (``n_init``), each run of the algorithm is computed in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/manifold/spectral_embedding_.py b/sklearn/manifold/spectral_embedding_.py index 22bd1c73b8e13..f500f82d03d2b 100644 --- a/sklearn/manifold/spectral_embedding_.py +++ b/sklearn/manifold/spectral_embedding_.py @@ -384,7 +384,7 @@ class SpectralEmbedding(BaseEstimator): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/metrics/pairwise.py b/sklearn/metrics/pairwise.py index 64f89a0ec1dfb..2e56255af0019 100644 --- a/sklearn/metrics/pairwise.py +++ b/sklearn/metrics/pairwise.py @@ -1186,7 +1186,7 @@ def pairwise_distances_chunked(X, Y=None, reduce_func=None, down the pairwise matrix into n_jobs even slices and computing them in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1348,7 +1348,7 @@ def pairwise_distances(X, Y=None, metric="euclidean", n_jobs=None, **kwds): down the pairwise matrix into n_jobs even slices and computing them in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1518,7 +1518,7 @@ def pairwise_kernels(X, Y=None, metric="linear", filter_params=False, down the pairwise matrix into n_jobs even slices and computing them in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/model_selection/_search.py b/sklearn/model_selection/_search.py index e32f973e54c99..fc3c6b16748e0 100644 --- a/sklearn/model_selection/_search.py +++ b/sklearn/model_selection/_search.py @@ -905,7 +905,7 @@ class GridSearchCV(BaseSearchCV): n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1252,7 +1252,7 @@ class RandomizedSearchCV(BaseSearchCV): n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/model_selection/_validation.py b/sklearn/model_selection/_validation.py index 205337531b00d..4ddfc5edac6ad 100644 --- a/sklearn/model_selection/_validation.py +++ b/sklearn/model_selection/_validation.py @@ -99,7 +99,7 @@ def cross_validate(estimator, X, y=None, groups=None, scoring=None, cv='warn', n_jobs : int or None, optional (default=None) The number of CPUs to use to do the computation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -323,7 +323,7 @@ def cross_val_score(estimator, X, y=None, groups=None, scoring=None, cv='warn', n_jobs : int or None, optional (default=None) The number of CPUs to use to do the computation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -698,7 +698,7 @@ def cross_val_predict(estimator, X, y=None, groups=None, cv='warn', n_jobs : int or None, optional (default=None) The number of CPUs to use to do the computation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -992,7 +992,7 @@ def permutation_test_score(estimator, X, y, groups=None, cv='warn', n_jobs : int or None, optional (default=None) The number of CPUs to use to do the computation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1150,7 +1150,7 @@ def learning_curve(estimator, X, y, groups=None, n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1397,7 +1397,7 @@ def validation_curve(estimator, X, y, param_name, param_range, groups=None, n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/multiclass.py b/sklearn/multiclass.py index 915210a5baa44..0361dfa4d4f3a 100644 --- a/sklearn/multiclass.py +++ b/sklearn/multiclass.py @@ -159,7 +159,7 @@ class OneVsRestClassifier(BaseEstimator, ClassifierMixin, MetaEstimatorMixin): n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -458,7 +458,7 @@ class OneVsOneClassifier(BaseEstimator, ClassifierMixin, MetaEstimatorMixin): n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -664,7 +664,7 @@ class OutputCodeClassifier(BaseEstimator, ClassifierMixin, MetaEstimatorMixin): n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/multioutput.py b/sklearn/multioutput.py index a5da7ff278e67..1b0fdd19e14af 100644 --- a/sklearn/multioutput.py +++ b/sklearn/multioutput.py @@ -211,7 +211,7 @@ class MultiOutputRegressor(MultiOutputEstimator, RegressorMixin): n_jobs : int or None, optional (default=None) The number of jobs to run in parallel for `fit`. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -301,7 +301,7 @@ class MultiOutputClassifier(MultiOutputEstimator, ClassifierMixin): n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. It does each target variable in y in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/neighbors/classification.py b/sklearn/neighbors/classification.py index dc44ff5b4e4c8..e84f9751d0089 100644 --- a/sklearn/neighbors/classification.py +++ b/sklearn/neighbors/classification.py @@ -77,7 +77,7 @@ class KNeighborsClassifier(NeighborsBase, KNeighborsMixin, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. Doesn't affect :meth:`fit` method. @@ -292,7 +292,7 @@ class RadiusNeighborsClassifier(NeighborsBase, RadiusNeighborsMixin, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/neighbors/graph.py b/sklearn/neighbors/graph.py index 4c29c2feacecb..3999ff458e121 100644 --- a/sklearn/neighbors/graph.py +++ b/sklearn/neighbors/graph.py @@ -72,7 +72,7 @@ def kneighbors_graph(X, n_neighbors, mode='connectivity', metric='minkowski', n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -150,7 +150,7 @@ def radius_neighbors_graph(X, radius, mode='connectivity', metric='minkowski', n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/neighbors/lof.py b/sklearn/neighbors/lof.py index b580a828c4c75..d688f3b38a743 100644 --- a/sklearn/neighbors/lof.py +++ b/sklearn/neighbors/lof.py @@ -112,7 +112,7 @@ class LocalOutlierFactor(NeighborsBase, KNeighborsMixin, UnsupervisedMixin, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. Affects only :meth:`kneighbors` and :meth:`kneighbors_graph` methods. diff --git a/sklearn/neighbors/regression.py b/sklearn/neighbors/regression.py index bead64c78443f..be4f835ff2a20 100644 --- a/sklearn/neighbors/regression.py +++ b/sklearn/neighbors/regression.py @@ -84,7 +84,7 @@ class KNeighborsRegressor(NeighborsBase, KNeighborsMixin, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. Doesn't affect :meth:`fit` method. @@ -242,7 +242,7 @@ class RadiusNeighborsRegressor(NeighborsBase, RadiusNeighborsMixin, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/neighbors/unsupervised.py b/sklearn/neighbors/unsupervised.py index f3e749b7ed04c..9d41b640f9e17 100644 --- a/sklearn/neighbors/unsupervised.py +++ b/sklearn/neighbors/unsupervised.py @@ -76,7 +76,7 @@ class NearestNeighbors(NeighborsBase, KNeighborsMixin, n_jobs : int or None, optional (default=None) The number of parallel jobs to run for neighbors search. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/pipeline.py b/sklearn/pipeline.py index f4e1ebacadb67..87d7180e0c230 100644 --- a/sklearn/pipeline.py +++ b/sklearn/pipeline.py @@ -642,7 +642,7 @@ class FeatureUnion(_BaseComposition, TransformerMixin): n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -849,7 +849,7 @@ def make_union(*transformers, **kwargs): n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/semi_supervised/label_propagation.py b/sklearn/semi_supervised/label_propagation.py index 05d547ea9d037..ff32005399fe2 100644 --- a/sklearn/semi_supervised/label_propagation.py +++ b/sklearn/semi_supervised/label_propagation.py @@ -103,7 +103,7 @@ class BaseLabelPropagation(six.with_metaclass(ABCMeta, BaseEstimator, n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. """ @@ -338,7 +338,7 @@ class LabelPropagation(BaseLabelPropagation): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -458,7 +458,7 @@ class LabelSpreading(BaseLabelPropagation): n_jobs : int or None, optional (default=None) The number of parallel jobs to run. - ``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context. + ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. From 896e900073f53f94e85f164afcb408efe325a7e6 Mon Sep 17 00:00:00 2001 From: Hanmin Qin Date: Thu, 16 Aug 2018 11:55:32 +0800 Subject: [PATCH 7/9] Joel's comment --- doc/glossary.rst | 5 +++-- sklearn/decomposition/dict_learning.py | 6 +++--- sklearn/decomposition/sparse_pca.py | 2 +- sklearn/linear_model/base.py | 3 ++- sklearn/linear_model/coordinate_descent.py | 6 ++++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/doc/glossary.rst b/doc/glossary.rst index 2fceb39020094..e5ecded890e11 100644 --- a/doc/glossary.rst +++ b/doc/glossary.rst @@ -1479,8 +1479,9 @@ functions or non-estimator constructors. ``n_jobs`` is an int, specifying the maximum number of concurrently running jobs. If set to -1, all CPUs are used. If 1 is given, no - parallel computing code is used at all. For n_jobs below -1, (n_cpus + - 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one are used. + parallel computing code is used at all, which is useful for debugging. + For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus for + n_jobs = -2, all CPUs but one are used. ``n_jobs=None`` means *unset*; it will generally be interpreted as ``n_jobs=1``, unless the current :class:`joblib.Parallel` backend diff --git a/sklearn/decomposition/dict_learning.py b/sklearn/decomposition/dict_learning.py index b810f98e080ec..252bf4b9a8a2b 100644 --- a/sklearn/decomposition/dict_learning.py +++ b/sklearn/decomposition/dict_learning.py @@ -959,7 +959,7 @@ class SparseCoder(BaseEstimator, SparseCodingMixin): performance of downstream classifiers. n_jobs : int or None, optional (default=None) - number of parallel jobs to run. + Number of parallel jobs to run. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1082,7 +1082,7 @@ class DictionaryLearning(BaseEstimator, SparseCodingMixin): `n_nonzero_coefs`. n_jobs : int or None, optional (default=None) - number of parallel jobs to run. + Number of parallel jobs to run. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -1236,7 +1236,7 @@ class MiniBatchDictionaryLearning(BaseEstimator, SparseCodingMixin): the estimated components are sparse. n_jobs : int or None, optional (default=None) - number of parallel jobs to run. + Number of parallel jobs to run. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/decomposition/sparse_pca.py b/sklearn/decomposition/sparse_pca.py index d676790a0d9e0..10eb8115411ae 100644 --- a/sklearn/decomposition/sparse_pca.py +++ b/sklearn/decomposition/sparse_pca.py @@ -273,7 +273,7 @@ class MiniBatchSparsePCA(SparsePCA): whether to shuffle the data before splitting it in batches n_jobs : int or None, optional (default=None) - number of parallel jobs to run. + Number of parallel jobs to run. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/base.py b/sklearn/linear_model/base.py index 83d2aa27599fd..30a28cd507f67 100644 --- a/sklearn/linear_model/base.py +++ b/sklearn/linear_model/base.py @@ -382,7 +382,8 @@ class LinearRegression(LinearModel, RegressorMixin): If True, X will be copied; else, it may be overwritten. n_jobs : int or None, optional (default=None) - The number of jobs to use for the computation. + The number of jobs to use for the computation. This will only provide + speedup for n_targets > 1 and sufficient large problems. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. diff --git a/sklearn/linear_model/coordinate_descent.py b/sklearn/linear_model/coordinate_descent.py index b9b5654cf9625..6fa71f2dddcf4 100644 --- a/sklearn/linear_model/coordinate_descent.py +++ b/sklearn/linear_model/coordinate_descent.py @@ -2019,7 +2019,8 @@ class MultiTaskElasticNetCV(LinearModelCV, RegressorMixin): Amount of verbosity. n_jobs : int or None, optional (default=None) - Number of CPUs to use during the cross validation. + Number of CPUs to use during the cross validation. Note that this is + used only if multiple values for l1_ratio are given. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. @@ -2192,7 +2193,8 @@ class MultiTaskLassoCV(LinearModelCV, RegressorMixin): Amount of verbosity. n_jobs : int or None, optional (default=None) - Number of CPUs to use during the cross validation. + Number of CPUs to use during the cross validation. Note that this is + used only if multiple values for l1_ratio are given. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary ` for more details. From 914315043ab6719417a7689b371e94e9e9aa1fa9 Mon Sep 17 00:00:00 2001 From: Hanmin Qin Date: Thu, 16 Aug 2018 17:23:48 +0800 Subject: [PATCH 8/9] Joel's comment --- doc/glossary.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/glossary.rst b/doc/glossary.rst index e5ecded890e11..5fac8b2ca282b 100644 --- a/doc/glossary.rst +++ b/doc/glossary.rst @@ -1479,9 +1479,9 @@ functions or non-estimator constructors. ``n_jobs`` is an int, specifying the maximum number of concurrently running jobs. If set to -1, all CPUs are used. If 1 is given, no - parallel computing code is used at all, which is useful for debugging. - For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus for - n_jobs = -2, all CPUs but one are used. + job-level parallel computing code is used at all, which is useful for + debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus + for n_jobs = -2, all CPUs but one are used. ``n_jobs=None`` means *unset*; it will generally be interpreted as ``n_jobs=1``, unless the current :class:`joblib.Parallel` backend From 9cbca9a2b7bcad1c299a18f79af1bf8c30f2244b Mon Sep 17 00:00:00 2001 From: Hanmin Qin Date: Fri, 17 Aug 2018 23:18:07 +0800 Subject: [PATCH 9/9] Roman's comment --- doc/glossary.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/glossary.rst b/doc/glossary.rst index 5fac8b2ca282b..4d93696c3ab38 100644 --- a/doc/glossary.rst +++ b/doc/glossary.rst @@ -1479,9 +1479,11 @@ functions or non-estimator constructors. ``n_jobs`` is an int, specifying the maximum number of concurrently running jobs. If set to -1, all CPUs are used. If 1 is given, no - job-level parallel computing code is used at all, which is useful for - debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus - for n_jobs = -2, all CPUs but one are used. + joblib level parallelism is used at all, which is useful for + debugging. Even with ``n_jobs = 1``, parallelism may occur due to + numerical processing libraries (see :ref:`FAQ `). + For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus for + ``n_jobs = -2``, all CPUs but one are used. ``n_jobs=None`` means *unset*; it will generally be interpreted as ``n_jobs=1``, unless the current :class:`joblib.Parallel` backend