Last answered:

28 Feb 2022

Posted on:

28 Feb 2022

0

when i run the code 'from sklearn import LinearRegression

after running the code' from sklearn import LinearRegression', I get this error message. I have also installed Sklearn on my anaconda, so now i have both scikit learn and sklearn which are basically the same thing I guess.

cannot import name 'LinearRegression' from 'sklearn' (C:\Users\DELL\anaconda3\lib\site-packages\sklearn\__init__.py)
1 answers ( 0 marked as helpful)
Instructor
Posted on:

28 Feb 2022

0

Hey,

Thank you for your comment and commitment to the Machine Learning in Python course!

As shown in the 'Simple Linear Regression' lesson, the LinearRegression class should be imported from the sklearn.linear_model module.

Hope this helps!

Kind regards,
365 Hristina

Submit an answer