confusionmatStats(g​roup,grouphat)

版本 1.3.0.0 (2.5 KB) 作者: Audrey Cheong
This function evaluates the common performance measures for classification models.
4.6K 次下载
更新时间 2015/10/12

查看许可证

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
%

引用格式

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

MATLAB 版本兼容性
创建方式 R2013a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
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