且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AttributeError:'str'对象在拟合Logistic回归模型中没有属性'decode'

更新时间:2023-12-01 22:02:16

我仍然尝试使用以下命令升级 scikit-learn ,但该命令仍未解决 AttributeError:'str'对象没有属性'decode'问题

I tried to upgrade my scikit-learn using the below command, still, that didn't solve the AttributeError: 'str' object has no attribute 'decode' issue

pip install scikit-learn  -U

最后,下面的代码片段解决了该问题,将求解器添加为 liblinear

Finally, below code snippet solved the issue, add the solver as liblinear

model = LogisticRegression(solver='liblinear')