필터 지우기
필터 지우기

Does NaN used in confusion matrix affects results?

조회 수: 2 (최근 30일)
Ekta Sharma
Ekta Sharma 2016년 6월 15일
댓글: Chad Greene 2016년 6월 17일
I have used confusion matrix and for making two matrices of equal dimensions I had used NaN but is it wise to use that? for example: A= [2 3 7 ]; B= [3 4 NaN]; C= A+B; C= 5 7 NaN I am getting where result should have been [5 7 7] according to me.Can anyone help? Thanx in advance.
  댓글 수: 3
Ekta Sharma
Ekta Sharma 2016년 6월 15일
Sir actually 0 is one the value in my matrix as I am using chain code,in that we have directions from 0 to 7.
Ekta Sharma
Ekta Sharma 2016년 6월 15일
Is there anything else we can do for making two matrices equal in length?

댓글을 달려면 로그인하십시오.

채택된 답변

Chad Greene
Chad Greene 2016년 6월 16일
Here's one way:
C = nansum([A; B])
C =
5 7 7
  댓글 수: 2
Ekta Sharma
Ekta Sharma 2016년 6월 17일
Sir may I know if I will keep using NaN in one of the matrices for making two matrices of equal dimensions.Will confusion matrix results such as true positive,false positive,true negative,false negatives values will get affected or not?
Chad Greene
Chad Greene 2016년 6월 17일
Using NaN as a place filler is often the best way to do it. The reason 1+NaN=NaN is because Matlab doesn't what the answer is if you add a number to something that is not a number. But the nansum function and its sisters (nanmean, nanmedian, etc) are available to simply ignore NaNs the way you want.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by