confusion matrix vs roc 100%
1 view (last 30 days)
Show older comments
Tomasz Kaczmarski
on 1 Apr 2020
Edited: Image Analyst
on 1 Apr 2020
Hello
when i plot roc im expecting straight line to top left (point(0,1) and then to top right(1,1) as mine confusion matrix was 100%
why im getting staright line as below
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/281304/image.png)
expected
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/281305/image.png)
0 Comments
Accepted Answer
Image Analyst
on 1 Apr 2020
Edited: Image Analyst
on 1 Apr 2020
Why do you think you'd get any more points on the ROC curve than 1 from a single confusion matrix? You won't. One confusion matrix will give you one point on the curve. This is because the sum of the columns in a row (not including the column on the diagonal) of your confusion matrix gives you exactly one false positive rate, not a whole bunch of them even though you analyzed a whole bunch of images to get that confusion matrix. So you get one point on the ROC curve. Then you have to change your algorithm parameters and run the test again and get another point, presumably with different false positive rate this time. Then, to build up the curve by getting a bunch of points on it, you need to repeat that (changing your parameters) until you get as many points along the curve as you want.
Your false positive rate is always 0 and you have just one point on it. If you want, you can add (0,0) and (1,1) to make the L shaped curve, but there's no requirement that your experiment will ever have those points. It's possible that with the given data, no matter what you do you'll never get 100% true positives, though you did here in what is probably a very noise-free, synthetic example, not a real world, noisy data set.
0 Comments
More Answers (0)
See Also
Categories
Find more on Detection in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!