How to Solve NameError: name 'LinearRegression' is not defined -- sklearn

Solution: Import the 'LinearRegression' module

To Solve the error, add the following line to the top of your code.

from sklearn.linear_model import LinearRegression

 

For more information:
Python sklearn LinearRegression