Logistic regression

Having issues with the practice lab assignment for the cost function it’s showing NameError X is not defined no matter what I do

1 Like

Check if you are using the correct variable names. Upper-case and lower-case letters matter in Python.

Also, note that every time you open a notebook, you must run all of the cells starting from the top.

1 Like

Thank you :folded_hands:

Because of what you said I saw my mistake and passed with full marks

1 Like

Dear @MATT20,

I hope you’ve resolved the issue. If you’re still experiencing difficulties, please send your notebook file via DM for further assistance.


Keep Learning AI with DeepLearning.AI - Girijesh

Cell #12. Can’t compile the student’s code. Error: ValueError(‘shapes (100,5) and (2,) not aligned: 5 (dim 1) != 2 (dim 0)’)

1 Like

Hi @RaheelZaman ,

The cell numbering is not an accurate reference to the code cell where the error is. You should find a unique reference #UNQ_C1, for example, at the start of a code cell.

Check if your code is using any fixed constant values, where it should be using a variable.

The tests in the notebook (and in the grader) use several different sizes of dataset for testing.

After writing the compute_cost function and running the code, and that of the cost function. I keep getting 0.007 instead of 0.693. Please what could be the cause of this, and how do I resolve it?

There is an error in your code.

Try looking at the “Hint” code in the following cells.