Confusion Matrix Results Sensitivity

12 次查看(过去 30 天)
How do I calculate the sensitivity and specificity with the confusionmat command? What is the position of TP, FP, FN, TN in the confusion matrix provided by matlab? I use the "confusionmat".

采纳的回答

YT
YT 2017-12-14
编辑:YT 2017-12-14
Just use the following.
[cm, order] = confusionmat(real_values,predicted_values)
Assuming your confusionmatrix is 2x2, it will look like this:
%CONFUSIONMAT OUTPUT
%%%%%%%%%%%%%%%%%%%%%%
% predicted
% | 0 1
% r -----------
% e 0 | TN FP
% a 1 | FN TP
% l
%%%%%%%%%%%%%%%%%%%%%%
*EDIT
confusionmat() does not calculate sensitivity, accuracy, F-score and those kind of derivations for you, you need to do them yourself. Just check this out, it's pretty easy.
  2 个评论
Gledson Melotti
Gledson Melotti 2018-3-15
Matlab does not calculate the measures (Fscore, TNR, TPR). So why does it provide the following command: accuracy = mean (diag (confMat))?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by