True Positives, False Positives, True Negatives, False Negatives from 2 Matrices

Returns TP, FP, TN, FN given 2 matrices populated with 1's and 0's
1.3K Downloads
Updated Mon, 28 Jul 2014 21:01:59 +0000

View License

- This simple function takes in 2 matrices of equal size populated with 1's and 0's and returns the number of True Positives, False Positives, True Negatives, False Negatives in order for precision and recall calculation
- 1st matrix is the true matrix
- 2nd matrix is the one populated from an algorithm used
- Returns error metrics based on a binary classification

Cite As

Jason Joseph Rebello (2024). True Positives, False Positives, True Negatives, False Negatives from 2 Matrices (https://www.mathworks.com/matlabcentral/fileexchange/47364-true-positives-false-positives-true-negatives-false-negatives-from-2-matrices), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Sparse Matrices in Help Center and MATLAB Answers

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.0