How measure sensitivity and specificity when using kfold cross validation?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Zeynab Mousavikhamene
el 9 de Abr. de 2020
Respondida: Divya Gaddipati
el 15 de Abr. de 2020
I need to measure the sensitivity and specificity on the observations not used fro training in kfold cross validation like kfoldLoss fucntion that measures classification loss for observations not used for training.
What function does that?
0 comentarios
Respuesta aceptada
Divya Gaddipati
el 15 de Abr. de 2020
Hi,
You can use confusionmat to obtain the True Positive (TP), True Negative (TN), False Positive (FP), False Negative (FN), which can be used to calculate the Sensitivity and Specificity using the formula:
Sensitivity = TP/(TP+FN)
Specificity = TN/(TN+FP)
[cm, order] = confusionmat(target, predicted)
%% Assuming your confusion matrix is 2x2, it will look like this:
% | 0 1
% -----------
% 0 | TN FP
% 1 | FN TP
For more information, you can refer to the following link:
Hope this helps!
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!