Week 2 practice lab: Linear regression - X not defined

I am trying to do the lab and am struggling as it continues to say I have not defined X.

In the practice labs for compute cost and gradient descent I do not see anywhere X is explicitly defined and I cannot get past this error to finish the lab.
Can you please advise?

Course: Supervised Machine Learning: Regression and Classification

Hi @hahazar

Make sure that you define x in a scope that can be accessed and also check if you haven’t written X instead of x. Also, ensure that you run all the cells especially the one that defines the variable x.

You can also take a look at this post:

Hope it helps! Feel free to ask if you need further assistance.

1 Like

All of the functions in this assignment use lower-case ‘x’.

Not ‘X’.

Letter case is important in python variable names.

1 Like

Thank you.

You’re welcome! happy to help.