WHY Different accuracy in Perceptron model?

In perceptron model:
It gives a accuracy of 78.47% using the fit() function but it gives 76.19% using the predict() function for the training data.
I don’t know why is it happening.

Here is the code;
wt_matrix = perceptron.fit(x_train,y_train,100,0.001) – This gives accuracy_score = 0.7847141190198367
Where as;
y_pred_train = perceptron.predict(x_train)
print(accuracy_score(y_pred_train,y_train)) --This gives accuracy_score = 0.7619603267211202

Hi @Deepak_Kumar,
Why is it that you’re using predict function for Training data?
I think it should have been same for both… can you share a link to your notebook?

Sorry for the late response.

Here is the link for the notebook:

and the link for the dataset is here:

Here the link of the both notebook and the dataset.
Please help how to fix this problem.

Not able to access your notebook.

Sorry @Ishvinder,
Now I’ve provided the access to both notebook and dataset.

Did u find out where was the problem occurred?

There’s no problem as such, but why are you even using predict function on training data?


for the same concern, this code

Y_predtrain = sn.predict(Xtrain)_

we are doing in every colab notebook to find training data accuracy, ain’t we? even in make_blobs datasets, we are finding training as well as validation data accuracy for both SNmodel and FFSNNetwork model.