#Train a linear Regression model

from sklearn.linear_model import LinearRegression
lin_reg=LinearRegression()
lin_reg.fit(housing_prepared,housing_labels)

i did not understand.

it is telling me housing_prepared not defined.

How can i fix it??
Please reply.

Hi, the error is self-explanatory. You have either not defined the housing_prepared variable, or have not executed the cell that contains that code.

I think .I did not write.

Please tell me where i have to defined it.

Please tell me the code.

Please check you complete code to find out where you have defined it, if you cannot find it that would mean that you did not define it and that is causing this error. Otherwise, please refer to the respective Jupyter notebook on our GitHub repository:

I know whrere i have defind housing_labels but i did not see in the lecture video defining housing_prepared.

So please tell me where and when i have to defind it??

Please tell me the code.

Please reply.

I am working with housing calafornia data not other.

You can find the complete code on our GitHub repository from the below link:

This files are not opening.

Please tell me how can i open it??

I got the code

Thanks