Course 2, Week 3 : 2.3 Using One Hot Encodings Exercise 3

I have implemented the function one_hot_matrix correctly as my output produces the text “All Tests Passed” , however the next pre-written cell results in multitudes of errors, and the output of the pre-written cell print statement after gives an error name ‘new_y_test’ is not defined. Is there code I am missing in the graded portion or is the supplied code incorrect. This error is preventing me from completing the cost function as it utilizes the undefined new_y_train.

2.3 Exercise 3 image:

I have resolved this, thank you.

It’s great to hear that you solved this under your own power. One common mistakes is to hard-wire the number of classes to 4, which works for the particular test case, but does not work in general.