sklearn Logistic Regression with n_jobs=-1 doesn't actually parallelize

[亡魂溺海] 提交于 2019-12-11 06:51:51

问题


I'm trying to train a huge dataset with sklearn's logistic regression. I've set the parameter n_jobs=-1 (also have tried n_jobs = 5, 10, ...), but when I open htop, I can see that it still uses only one core.

Does it mean that logistic regression just ignores the n_jobs parameter?

How can I fix this? I really need this process to become parallelized...

P.S. I am using sklearn 0.17.1


回答1:


the parallel process backend also depends on the solver method. if you want to utilize multi core, the multiprocessing backend is needed.

but solver like 'sag' can only use threading backend.

and also mostly, it can be blocked due to a lot of pre-processing.



来源:https://stackoverflow.com/questions/39620185/sklearn-logistic-regression-with-n-jobs-1-doesnt-actually-parallelize

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!