python3 AttributeError: module 'sklearn' has no attribute 'linear_model'
以下导入方式报错
import sklearn lr = sklearn.linear_model.LinearRegression() # 需要导入sklearn的linear_model
修改导入方式即可如下:
from sklearn.linear_model import LinearRegression lr = LinearRegression() # 需要导入sklearn的linear_model