如何使用 sklearn LogisticRegression 启用多核处理?
How to enable multicore processing with sklearn LogisticRegression?
Sklearn 的 LogisticRegression 模型拒绝 运行 并行。我设置了n_jobs=-1,也试过n_jobs=4。运气不好——只有一个核心在使用。我有 运行 并行的其他 sklearn 模型,例如 RandomForestClassifier 和 XGBoostClassifier。
我 运行宁 Python 2.7.12 与 sklearn 0.18 Ubuntu 14.04.
其他人也问过同样的问题(例如,here),到目前为止还没有收到任何有希望的答复。我希望我的运气会更好。
从 LogisticRegresssion
的 doco 看来,n_jobs
参数仅用于单独的交叉验证折叠(与 RandomForestClassifier
的情况不同,其中计算单个树平行线)。
n_jobs : int, default: 1
Number of CPU cores used during the cross-validation loop. If given
a value of -1, all cores are used.
Sklearn 的 LogisticRegression 模型拒绝 运行 并行。我设置了n_jobs=-1,也试过n_jobs=4。运气不好——只有一个核心在使用。我有 运行 并行的其他 sklearn 模型,例如 RandomForestClassifier 和 XGBoostClassifier。
我 运行宁 Python 2.7.12 与 sklearn 0.18 Ubuntu 14.04.
其他人也问过同样的问题(例如,here),到目前为止还没有收到任何有希望的答复。我希望我的运气会更好。
从 LogisticRegresssion
的 doco 看来,n_jobs
参数仅用于单独的交叉验证折叠(与 RandomForestClassifier
的情况不同,其中计算单个树平行线)。
n_jobs : int, default: 1
Number of CPU cores used during the cross-validation loop. If given a value of -1, all cores are used.