confusion
분류 혼동행렬
설명
예제
confusion
함수를 사용하여 simpleclass
데이터셋의 혼동행렬 생성하기
이 예제에서는 confusion
함수를 사용하여 simpleclass_dataset
데이터셋의 혼동행렬을 생성하는 방법을 보여줍니다.
simpleclass_dataset
데이터셋을 불러옵니다. 신경망을 정의한 다음 훈련시킵니다.
[x,t] = simpleclass_dataset; net = patternnet(10); net = train(net,x,t); y = net(x); [c,cm,ind,per] = confusion(t,y)
a3 = 1 2 3 1 2 3 4 5 6 4 5 6 7 7 7 8 8 8 9 9 9 10 10 10
입력 인수
targets
— 목표값으로 구성된 행렬
행렬
목표값으로 구성된 행렬로, S
×Q
행렬로 지정됩니다. 여기서 각 열 벡터에는 하나의 1
값이 있고 나머지 모든 요소는 0
입니다. 값 1
의 인덱스는 S
개의 범주 중에서 이 벡터가 나타내는 범주가 무엇인지를 지정합니다.
outputs
— 출력값으로 구성된 행렬
행렬
출력값으로 구성된 행렬로, S
×Q
행렬로 지정됩니다. 여기서 각 열에는 [0,1]
범위의 값이 있습니다. 열에 있는 가장 큰 요소의 인덱스는 S
개의 범주 중에서 이 벡터가 나타내는 범주가 무엇인지를 지정합니다.
출력 인수
c
— 혼동 값
스칼라
오분류된 샘플의 비율로, 스칼라로 반환됩니다.
cm
— 혼동행렬
행렬
혼동행렬로, S
×S
혼동행렬로 반환됩니다. cm(i,j)
는 목표가 i
번째 클래스인데 j
로 분류된 샘플의 개수입니다.
ind
— 인덱스로 구성된 배열
셀형 배열
인덱스로 구성된 배열로, S
×S
셀형 배열로 반환됩니다. ind{i,j}
에는 목표가 i
번째 클래스인데 출력은 j
번째 클래스인 샘플의 인덱스가 있습니다.
per
— 백분율 값으로 구성된 행렬
행렬
백분율 값으로 구성된 행렬로, S
×4
행렬로 반환됩니다. 각 행은 i
번째 클래스와 연관된 다음 4개의 백분율 값을 나타냅니다.
per(i,1) false negative rate = (false negatives)/(all output negatives) per(i,2) false positive rate = (false positives)/(all output positives) per(i,3) true positive rate = (true positives)/(all output positives) per(i,4) true negative rate = (true negatives)/(all output negatives)
버전 내역
R2006a에 개발됨
참고 항목
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)