diff --git a/doc/whats_new/v0.20.rst b/doc/whats_new/v0.20.rst index 73c607adb1633..0afda87c3480b 100644 --- a/doc/whats_new/v0.20.rst +++ b/doc/whats_new/v0.20.rst @@ -22,6 +22,13 @@ Changelog threaded when `n_jobs > 1` or `n_jobs = -1`. :issue:`12949` by :user:`Prabakaran Kumaresshan `. +:mod:`sklearn.decomposition` +........................... + +- |Fix| Fixed a bug in :func:`decomposition.sparse_encode` where computation was single + threaded when `n_jobs > 1` or `n_jobs = -1`. + :issue:`13005` by :user:`Prabakaran Kumaresshan `. + :mod:`sklearn.linear_model` ........................... diff --git a/sklearn/decomposition/dict_learning.py b/sklearn/decomposition/dict_learning.py index eb5e4f2588612..1c16782bb3496 100644 --- a/sklearn/decomposition/dict_learning.py +++ b/sklearn/decomposition/dict_learning.py @@ -300,7 +300,7 @@ def sparse_encode(X, dictionary, gram=None, cov=None, algorithm='lasso_lars', if regularization is None: regularization = 1. - if effective_n_jobs(n_jobs) or algorithm == 'threshold': + if effective_n_jobs(n_jobs) == 1 or algorithm == 'threshold': code = _sparse_encode(X, dictionary, gram, cov=cov, algorithm=algorithm,