Programming Assignment of week2 of Supervised Machine Learning

I am stuck at Programming assignment of Week 2 of Supervised Machine Learning Course. As on submission i get this error, The truth value of an array with more than one element is ambiguous. Use a.any() or a.all(). And I’m unable to understand this and I get 0 grades and i can’t move ahead.

1 Like

This kind of error can happen because the grader uses different tests than the notebook uses.

I expect this means that somewhere in your code, you’re computing a result that is a vector, when a scalar is expected.

Try reviewing all of the results from the test cases in the notebook, and check if any of them display a list of values where the Expected Output has just a single value.

1 Like

I had tried editing the pre coded cells, and I’m getting the same error at notebook tests. I don’t know why.
It’ll be helpful if you help me regardíng this.
Thanks & Best Regards.
Muhammad Zohaib Ali.

1 Like

That can cause problems. Maybe it would be best if you start over with a clean copy of the notebook.

1 Like

Hi,

Please I need assistance this is the error that I’m getting when I tried to submit the programming assignments “Comment line with index: UNQ_C1 wasn’t found in code”

Note that I’m have the same issue for both Week 2 and Week 3.

1 Like

This means you deleted the line of comment code that the grader uses to identify the graded cells.

1 Like

How can I get it back?

1 Like

If you post the first few line of each code cell where the error is happening, I’ll post back the code you should add back in.

1 Like

Or, you can save your current notebook as a new file name, and then use the “Help → Get latest version” button to get a new copy of the notebook.

Then you would have to copy all your added code from the old notebook to the new one.

1 Like

Hello @Antonio_Ngbesu_Manze,

Would this be illustrative enough for how to add them back yourself?

https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-mls-courses/184322/6#code-error-how-to-solve-this-error-unq_cx-wasnt-found-in-code-11

Cheers,
Raymond

1 Like

@Antonio_Ngbesu_Manze, that should be sufficient for you to figure out for yourself what code you deleted and need to add back.

1 Like

It works, thanks Raymond.

1 Like