在导入代码时出现LogisticRegression的导入错误。
from sklearn.model_selection import LogisticRegression
错误:-
Traceback (most recent call last):
File "e:\VSCODE\GIT_Hub\myML\Proj2-FruitSurvey-SimpleClassificationModels\ML-Models.py", line 78, in <module>
from sklearn.model_selection import LogisticRegression
ImportError: cannot import name 'LogisticRegression'
加载其他模块(如
)时我没有问题from sklearn.model_selection import GridSearchCV,cross_validate
from sklearn.model_selection import train_test_split
我正在使用python版本= 3.6.5 scikit-learn = 0.21.0 窗户10 代码编辑器= vscode
答案 0 :(得分:1)
它在sklearn.linear_model
,https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html