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.