ValueError: operands could not be broadcast together with shapes (750, 4) (750,)

Broadcasting issue

You can resolve the error by explicitly reshaping Y_pred or pred.
But logically, number of columns in Y and Y_pred should be same to start with.

Can you share link to your notebook?

https://colab.research.google.com/drive/16DB_JEaLzo0verL6q7bVUo2_uYqc6_VM#scrollTo=8en4QbAmZOVB

Not accessible. Make the link accessible to anyone.

https://colab.research.google.com/drive/16DB_JEaLzo0verL6q7bVUo2_uYqc6_VM?usp=sharing

ffsnn_multi.fit(X_train, Y_train, epochs=2000, learning_rate=0.005, display_loss=True)

Here, instead of Y_train, you have to send one-hot-encoded vector i.e. Y_OH_train

1 Like