python - 提高 scikit-learn 多项逻辑回归的速度
问题描述
我正在尝试在 scikit learn 中训练一个逻辑回归模型,训练需要很长时间,大约 2 小时。数据集的大小为 21613 x 19。我是 scikit learn 的新手,因此我不知道我的代码是否错误,或者训练需要很长时间。任何有关如何提高训练速度的建议将不胜感激!
用于训练的代码如下
# get the LogisticRegression estimator
from sklearn.linear_model import LogisticRegression
# training the model
# apply algorithm to data using fit()
clf = LogisticRegression(solver='newton-cg',multi_class='multinomial')
clf.fit(X_train,y_train)
解决方案
推荐阅读
- python - IOError: [Errno 24] 打开的文件太多 - 但我关闭了所有文件
- javascript - ReactJs 组件结构 - 模态内的表单
- python - 'make pycaffe' 错误应该怎么办?
- bash - 在bash中拆分列表
- python-2.7 - 我如何覆盖按钮“打印”的打印功能
- javascript - 如何在对象数组上使用 localStorage
- c++ - 在给定数组中生成所有元素对的有效方法
- java - 我们能否在到达服务器之前识别http(post)请求是否被修改?
- java - 如何在sqlite中保存Servervalue.TIMESTAMP?
- azure-devops - VSTS 错误:未找到与模式匹配的测试程序集