In keras we could train model using fit command and then use predict.
Dcnn=model.fit(x_train, y_train, epochs=5, batch_size=32)
model.predict(test_dataset,verbose=True)
when we use fit method we get accuracy results as below. Lets say after 5 epochs we got accuracy of 98.62% on the training data. Now if we use model.predict(x_train,verbose=True) would we get the exact same accuracy and exactly same predictions for each observation as shown in the outcome of fit method? if not, why?
Epoch 5/5
61/61 - 11s - loss: 0.0320 - tp: 1602.0000 - fp: 18.0000 - tn: 321.0000 - fn: 9.0000 - accuracy: 0.9862
update1
I updated commands as below
Dcnn.fit(train_dataset,
epochs=NB_EPOCHS,
verbose=2,validation_data=test_dataset)
and i got below results
Epoch 5/5
61/61 - 11s - loss: 0.0320 - tp: 1602.0000 - fp: 18.0000 - tn: 321.0000 - fn: 9.0000 - accuracy: 0.9862 - precision: 0.9889 - recall: 0.9944 - auc: 0.9990 - val_loss: 0.9760 - val_tp: 161.0000 - val_fp: 22.0000 - val_tn: 9.0000 - val_fn: 0.0000e+00 - val_accuracy: 0.8854 - val_precision: 0.8798 - val_recall: 1.0000 - val_auc: 0.7169
Now if i try model.predict(test_dataset,verbose=True) I get 88.54% accuracy - same as output of the fit method.
If i run model.predict(train_dataset,verbose=True), would i get accuracy 98.62%? if no, then why?