ValueError: Found input variables with inconsistent numbers of samples

Already spent an hour to debug still can’t find what’s wrong here ?
Please help.

Can you share link to your code?

yes!
https://colab.research.google.com/drive/15pNOBKoNYqSdaf9z1W-4ONP3u2WS1vCm?usp=sharing

Change small x in code below to capital X

        if display_loss:
            Y_pred = self.sigmoid(self.perceptron(x))

After fixing this, it will throw another error for loss.values()

    if display_loss:
        plt.plot(loss.values())

you can fix it by wrapping loss.values() inside list()

    if display_loss:
        plt.plot(list(loss.values()))
1 Like

yes its working fine now. Thank you so much for your time. :slight_smile: