Python Forum
Help in adding confusion matrix
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help in adding confusion matrix
#2
Something like this, but not tested:

import numpy as np # move to the beginning of the file
from sklearn.metrics import confusion_matrix 
# ....
_ = classifier.predict_generator(test_set, num_of_test_samples // batch_size+1)
y_pred = np.argmax(_, axis=1)
print('Confusion Matrix')
print(confusion_matrix(test_set.classes, y_pred))
Reply


Messages In This Thread
Help in adding confusion matrix - by Aashish - Apr-13-2019, 04:27 AM
RE: Help in adding confusion matrix - by scidam - Apr-14-2019, 12:28 PM
RE: Help in adding confusion matrix - by Aashish - Apr-15-2019, 03:50 AM
RE: Help in adding confusion matrix - by scidam - Apr-15-2019, 06:04 AM
RE: Help in adding confusion matrix - by Aashish - Apr-15-2019, 03:10 PM
RE: Help in adding confusion matrix - by scidam - Apr-15-2019, 11:45 PM
RE: Help in adding confusion matrix - by AndresGmz - Sep-11-2019, 05:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Alternative ways of plotting confusion matrix amjass12 0 2,439 Aug-14-2019, 07:21 PM
Last Post: amjass12
  PyCM 1.8 released: Machine learning library for confusion matrix statistical analysis sepandhaghighi 0 2,176 Jan-05-2019, 12:36 PM
Last Post: sepandhaghighi

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020