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.
Asked
Active
Viewed 148 times
-1

Ganesh Kuikel
- 25
- 6
-
1add shuffle=False and try – venkata krishnan Jun 22 '20 at 06:19
-
Thank you very much venkata krishnan it worked finally. Can you please tell me what does this shuffle. – Ganesh Kuikel Jun 23 '20 at 07:35
-
i will post it as an answer, so that it helps future users. do accept the answer, if you find it useful. – venkata krishnan Jun 23 '20 at 12:56
1 Answers
1
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.

venkata krishnan
- 1,961
- 1
- 13
- 20