confusionmatStats(g​roup,grouphat)

This function evaluates the common performance measures for classification models.
4,6K Downloads
Aktualisiert 12. Okt 2015

Lizenz anzeigen

function stats = confusionmatStats(group,grouphat)
% INPUT
% group = true class labels
% grouphat = predicted class labels
%
% OR INPUT
% stats = confusionmatStats(group);
% group = confusion matrix from matlab function (confusionmat)
%
% OUTPUT
% stats is a structure array
% stats.confusionMat
% Predicted Classes
% p' n'
% ___|_____|_____|
% Actual p | | |
% Classes n | | |
%
% stats.accuracy = (TP + TN)/(TP + FP + FN + TN) ; the average accuracy is returned
% stats.precision = TP / (TP + FP) % for each class label
% stats.sensitivity = TP / (TP + FN) % for each class label
% stats.specificity = TN / (FP + TN) % for each class label
% stats.recall = sensitivity % for each class label
% stats.F-score = 2*TP /(2*TP + FP + FN) % for each class label
%
% TP: true positive, TN: true negative,
% FP: false positive, FN: false negative
%

Zitieren als

Audrey Cheong (2024). confusionmatStats(group,grouphat) (https://www.mathworks.com/matlabcentral/fileexchange/46035-confusionmatstats-group-grouphat), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2013a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.3.0.0

Accuracy formula corrected. Added group/class label order.
Bug fix (F-score to Fscore)

1.2.0.0

function title

1.1.0.0

Added two comments

1.0.0.0