Skip to content

Commit ca32cbb

Browse files
add warning message about using logreg in parallel (#2860)
1 parent ce6bac1 commit ca32cbb

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

doc/sources/algorithms.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ Classification
9292
- ``class_weight`` != ``None``
9393
- Solver ``'newton-cg'`` with ``fit_intercept`` = ``False`` is not supported
9494
- Sparse data is not supported.
95-
- Solver ``'newton-cg'`` is **only** available in :doc:`preview mode <preview>`.
95+
- Solver ``'newton-cg'`` is **only** available in :doc:`preview mode <preview>`. **Important:** this estimator should not be used
96+
in parallel Python threads - for concurrent fits (e.g. from :obj:`sklearn.model_selection.GridSearchCV`),
97+
process-based parallelism should be used instead (default backend for :mod:`joblib`).
9698
* - :obj:`sklearn.linear_model.LogisticRegressionCV`
9799
- All parameters are supported except:
98100

doc/sources/parallelism.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ If ``n_jobs`` is not specified for underlying estimator(s), |sklearnex| sets it
7474
If concurrent calls are to be performed, process-based parallelism should
7575
be used instead.
7676

77+
.. warning::
78+
The patched classes :obj:`sklearn.linear_model.LogisticRegression` and
79+
:obj:`sklearn.linear_model.LogisticRegressionCV` in particular are not
80+
suitable for parallel calls in Python threads regardless of the ``n_jobs`` parameter.
81+
Attempting to fit multiple logistic regression estimator objects in parallel
82+
might result in crashes and incorrect estimations.
83+
7784
Setting the `DEBUG` :ref:`verbosity setting <verbose>` will produce logs
7885
indicating when the number of threads used is different from the default
7986
(number of logical threads in the machine).

0 commit comments

Comments
 (0)