W3-c1 error


I got this error I don’t know what’s wrong, would you pleas help me?

1 Like

Hi @Maryam_khodaparast,

The part where you have to do one-hot encoding, if you click on the dropdown Hints section, it tells you that you have to use keras.utils.to_categorical(y, num_classes=) function.

Fix that and it will work.

Best,
Mubsi

Thanks it was helpful , I have another problem with C5-W3 I can not pass all the test.

Hi @Maryam_khodaparast,

The way you have broken down the logic is correct. But you are summing before squaring. This is not the same as squaring before summing, which is what is expected here.

To give you an example:

  • Summing before squaring,
    3 + 4 = 7, 7^2 =49

  • Squaring before summing,
    3^2 = 9, 4^2 = 16, 9 + 16 = 25

Best,
Mubsi