当使用  

import sklearn

sklearn.linear_model.LogisticRegression()  报如下错误

AttributeError: module 'sklearn' has no attribute 'linear_model'

 

修改为:

from sklearn.linear_model import LogisticRegression

LogisticRegression()

即可

 

好像sklearn不会自动导入其子包

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-15
  • 2021-05-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-06
  • 2021-05-16
  • 2021-09-29
  • 2022-12-23
  • 2021-05-15
  • 2021-05-25
  • 2022-12-23
相关资源
相似解决方案