precision and recall of two matrices

2 次查看(过去 30 天)
I have two binary matrices 701x701 each. One represents what i got from my algorithm and the other is the groundtruth of the dataset i'm using. In each column i have a 1 if the photo is considered near duplicate, if not is a 0, in each row i have a different photo. Both matrix have the diagonal composed by ones. (The dataset is composed by 701 photos.) I have to calculate recall and precision. The problem is that i don't know wich one is false positive, true positive, false negative or true negative. How can i do it?

采纳的回答

Michael Abboud
Michael Abboud 2017-8-28
For a typical classification problem where each input image receives a single label you can use the 'confusion' function to calculate these statistics: http://www.mathworks.com/help/nnet/ref/confusion.html
However, it sounds like you have a special case where each input image gives a full output of length 701 where any number of them can be 0s or 1s. My guess is that the above function was not designed for this use, and it may even be that the statistics you mention are not well defined for the type of problem you have described above.
I would recommend that you look at the Wikipedia page on Confusion Matrices, which nicely explains the various statistics: https://en.wikipedia.org/wiki/Confusion_matrix
It may be possible to simply convert each matrix into a long vector of 1s and 0s and from here calculate precision and recall according to the formulas, however I'm not fully convinced this would be the correct approach as it discards a vast amount of semantic meaning and may only serve to provide some ballpark statistics

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by