Hi,
I understand that you want to compute the following metrics to evaluate your model. I hope the following explaination helps you in doing so.
Assume the following notations:
C: represent number of classes
: true positives
: false negatives
: True negatives
: False positivesN: total number of test samples
Also, the following is explained for C = 2 , it can be generalized for any value of C.
[ConfusionMat,order] = confusionmat(Y,prediction);
After you have the confusion matrix, you can compute the following metrics using given formulas:
For your problem, compute Kappa as the following: