C5 W2 A2, function model

Hi everyone,

I have a problem with the “accuracy” in this assigment. I get 0.9166 accuracy but I must have “perfect accuracy”.

I think the problem is I don’t understand the “avg part” in this assigment.

I think avg = np.zeros(n_h) / …

At the moment I use avg = np.zeros(n_h) / n_y but this is not correct.

Can someone help me?

In the model() function, setting the avg to all-zeros is not useful.
Try using the sentence_to_avg(…) function for that calculation.

It works now. Thanks for help!