Confusion Matrix (size: nxn) - 12 Parameter Function

After creation of a Machine Learning (ML) model, 12 performance parameters have been calculated using the following function out of CF(nxn).
6 Downloads
Updated 13 Mar 2023

View License

"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 Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0