I am having unbalanced dataset(1:93) and want to use kappa's metric. However, for that I need to capture how many correct predictions are made for each class.

I have tried understanding from here and other google links.

Is it possible to capture class wise #correct predictions made?


1 Answer 1


That's true. For understanding how many correct decision your classifier has made, confusion matrix can be used. The main diagonal illustrates that. It depicts how many data samples are correctly classified and how many are mislabeled to which class. you can take a look at here.

  • $\begingroup$ but how do i get confusion matrix in keras? $\endgroup$ Feb 1, 2018 at 5:40
  • $\begingroup$ @user5722540 you mean how to write it? $\endgroup$ Feb 1, 2018 at 5:41
  • $\begingroup$ y_true and y_pred give the number of true and predicted in totality, but how do we get the number for each class? $\endgroup$ Feb 1, 2018 at 5:42
  • 1
    $\begingroup$ no don't use that. can you take a look at here? $\endgroup$ Feb 1, 2018 at 5:43
  • $\begingroup$ that shows visualization of confusion matrix. but i want to use en.wikipedia.org/wiki/Cohen%27s_kappa as a metric not for visualization purpose $\endgroup$ Feb 1, 2018 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.