I have done fruit detection image classification problem using CNN i have done all the things upto training and fitting the model and my accuracy and validation accuracy are almost 100% but when i try to print classification report and confusion matrix from my model it always shows precision, recall and final accuracy is always 0.01% and confusion matrix is also bizzare. Why is this happenning please help me. Code is available at code section. Thank you.
You test data is being shuffled, and that's why the classification report gives lower accuracy. Use
shuffle=False
for the test set while predicting, so that, you maintain the order of the prediction, in turn comparing it with the correct ground truth value.