ImportError: cannot import name 'LinearRegression' from 'sklearn'

in Machine Learning
Machine Learning Tutorials
1 Answers to this question

You have received this error as the LinearRegression is present in the sklearn.model_selection module. To rectify the error, you will need to use the below code.


from sklearn.linear_model import LinearRegression


You need to make sure that the sklearn module is installed in your system.

If you want to unleash your potential in this competitive field, please visit the Machine Learning Training page for more information, where you can find the       and       as well.

For more updates on the latest courses stay tuned to HKR Trainings.

To Top