[scikit-learn] n_jobs for LogisticRegression

Tom DLT tom.duprelatour at orange.fr
Mon Dec 19 10:14:37 EST 2016


Hi,

In LogisticRegression, n_jobs is only used for one-vs-rest parallelization.
In LogisticRegressionCV, n_jobs is used for both one-vs-rest and
cross-validation parallelizations.

So in LogisticRegression with multi_class='multinomial', n_jobs should have
no impact.

The docstring should probably be updated as you mentioned. PR welcome :)

Best,
Tom

2016-12-19 6:13 GMT+01:00 Sebastian Raschka <se.raschka at gmail.com>:

> Hi,
>
> I just got confused what exactly n_jobs does for LogisticRegression.
> Always thought that it was used for one-vs-rest learning, fitting the
> models for binary classification in parallel. However, it also seem to do
> sth in the multinomial case (at least according to the verbose option). in
> the docstring it says
>
> >     n_jobs : int, optional
> >         Number of CPU cores used during the cross-validation loop. If
> given
> >         a value of -1, all cores are used.
>
> and I saw a logistic_regression_path being defined in the code. I am
> wondering, is this just a workaround for the LogisticRegressionCV, and
> should the n_jobs docstring in LogisticRegression
> be described as "Number of CPU cores used for model fitting” instead of
> “during cross-validation,” or am I getting this wrong?
>
> Best,
> Sebastian
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20161219/81857dc7/attachment.html>


More information about the scikit-learn mailing list