필터 지우기
필터 지우기

What are the positions of the elements of the confusion matrix? How to calculate accuracy and fscore of the matrix of confusion using matlab?

조회 수: 3 (최근 30일)
For example, the confusion matrix (confMat) is: confMat(1,1) = 104, confMat(1,2) = 1242, confMat(2,1) = 14 and confMat(2,2) = 14199. In matalab using accuracy = mean(diag(confMat)) provides 0.5381. However, using the relation: accuracy=(TP+TN)/(TP+TN+FP+FN)=91.92. I have two classes and unbalanced dataset.
I believe the matrix of confusion in matlab is: confMat(1,1) = TN, confMat (1,2) = FP, confMat (2,1) = FN and confMat(2,2) = TP. Whereas: Horizontal = predicted class and Vertical = real class

채택된 답변

Morteza
Morteza 2019년 7월 12일
Your final belief is correct.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by