Confusion Matrix (size: nxn) - 12 Parameter Function
Version 1.0.0 (1.55 KB) by
Sambit Supriya Dash
After creation of a Machine Learning (ML) model, 12 performance parameters have been calculated using the following function out of CF(nxn).
"CF" is abb. for Confusion Matrix generated of any size,
For example, use this CF, and for beta = 1, use this function given in the code.
Directly, paste the function in the same folder as the main script.
% Main Script
CF = [220, 75, 89; 94, 43, 57; 21, 26, 58]; % Confusion Matrix
beta = 1; % corrector
[TP,FP,FN,TN,precision,recall,F1,accuracy,specificity,sensitivity,prevalence,...
PPV,NPV,detection_rate,detection_prevalence,balanced_acc] = confusionMatrix(CF,beta);
Cite As
Sambit Supriya Dash (2024). Confusion Matrix (size: nxn) - 12 Parameter Function (https://www.mathworks.com/matlabcentral/fileexchange/126165-confusion-matrix-size-nxn-12-parameter-function), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2022b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |