首页 > 解决方案 > 提高 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)

标签: pythonscikit-learn

解决方案



推荐阅读