My features_and_labels() function returns the features array for the first example of shape (5 , 10), while the “Expected Output” box shows the features array of shape (5, 5) with the extra zeros at the front of the last (longest) n-gram truncated (see the screenshot attached).
I did not set truncating =‘pre’ in the pad_seqs() function and, when tested, it returned a correct output matching the “Expected Output”. Should I? Is it the reason why I got a lower grade for the assignment (see below)?
My model achieved the 80% accuracy threshold and I passed the Grader with 88%. But I am not satisfied, until I figure out why it shows am error (see attached a screenshot of the Grader’s output). The Grader says “operands could not be broadcast together with shapes (5,10) (5,4)”. Any hint where the bug(s) might be?