SlideShare a Scribd company logo
Confusion
Matrix
+
ROC Curve
by. Hongjin
Contents
1. Confusion Matrix
2. Distribution Graph
4. Conclusion
3. ROC Curve + AUC
·Sensitivity(Recall, True Positive Rate) :
𝑇𝑃
𝑇𝑃+𝐹𝑁
1. Confusion Matrix
Prediction
Positive Negative
Actual
Positive TP FN
Negative FP TN
·Specificity :
𝑇𝑁
𝐹𝑃+𝑇𝑁
·Accuracy :
𝑇𝑃+𝑇𝑁
𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁
·Precision :
𝑇𝑃
𝑇𝑃+𝐹𝑃
·Error Rate : 1 - Accuracy
·False Positive Rate : 1 - Specificity
어우..
한글로, 예시를 들어서 설명
예측
환자다(P) 아니다(N)
실제
환자 TP FN
아님 FP TN
·TP : True Positive, 예측 P, 실제도 P
·FP : False Positive, 예측 P, 실제는 N
·TN : True Negative, 예측 N, 실제도 N
·FN : True Negative, 예측 N, 실제는 P
맞음!
틀림!
예측이!
예측이!
-> 예측(P/N)을 기준으로 두고, True/False 를 맞음/틀림 으로 접근!
하기 전에, 잠깐!
·Sensitivity(Recall, True Positive Rate) :
𝑇𝑃
𝑇𝑃+𝐹𝑁
1. Confusion Matrix (혼동 행렬)
예측
환자다 아니다
실제
환자 TP FN
아님 FP TN
·Specificity :
𝑇𝑁
𝐹𝑃+𝑇𝑁
·Accuracy :
𝑇𝑃+𝑇𝑁
𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁
·Precision :
𝑇𝑃
𝑇𝑃+𝐹𝑃
·Error Rate : 1 - Accuracy
·False Positive Rate : 1 - Specificity
-> 정확도 : 맞게 예측 / 전체
·Sensitivity(Recall, True Positive Rate) :
𝑇𝑃
𝑇𝑃+𝐹𝑁
예측
환자다 아니다
실제
환자 TP FN
아님 FP TN
·Specificity :
𝑇𝑁
𝐹𝑃+𝑇𝑁
·Accuracy :
𝑇𝑃+𝑇𝑁
𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁
·Precision :
𝑇𝑃
𝑇𝑃+𝐹𝑃
·Error Rate : 1 - Accuracy
·False Positive Rate : 1 - Specificity
-> 정확도 : 맞게 예측 / 전체
-> 민감도 : 맞게 예측 / 실제 환자
1. Confusion Matrix (혼동 행렬)
·Sensitivity(Recall, True Positive Rate) :
𝑇𝑃
𝑇𝑃+𝐹𝑁
예측
환자다 아니다
실제
환자 TP FN
아님 FP TN
·Specificity :
𝑇𝑁
𝐹𝑃+𝑇𝑁
·Accuracy :
𝑇𝑃+𝑇𝑁
𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁
·Precision :
𝑇𝑃
𝑇𝑃+𝐹𝑃
·Error Rate : 1 - Accuracy
·False Positive Rate : 1 - Specificity
-> 정확도 : 맞게 예측 / 전체
-> 민감도 : 맞게 예측 / 실제 환자
-> 정밀도 : 맞게 예측 / 예측 환자
1. Confusion Matrix (혼동 행렬)
·Sensitivity(Recall, True Positive Rate) :
𝑇𝑃
𝑇𝑃+𝐹𝑁
예측
환자다 아니다
실제
환자 TP FN
아님 FP TN
·Specificity :
𝑇𝑁
𝐹𝑃+𝑇𝑁
·Accuracy :
𝑇𝑃+𝑇𝑁
𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁
·Precision :
𝑇𝑃
𝑇𝑃+𝐹𝑃
·Error Rate : 1 - Accuracy
·False Positive Rate : 1 - Specificity
-> 정확도 : 맞게 예측 / 전체
-> 민감도 : 맞게 예측 / 실제 환자
-> 정밀도 : 맞게 예측 / 예측 환자
-> 특이도 : 맞게 예측 / 실제 아님
1. Confusion Matrix (혼동 행렬)
·Sensitivity(Recall, True Positive Rate) :
𝑇𝑃
𝑇𝑃+𝐹𝑁
예측
환자다 아니다
실제
환자 TP FN
아님 FP TN
·Specificity :
𝑇𝑁
𝐹𝑃+𝑇𝑁
·Accuracy :
𝑇𝑃+𝑇𝑁
𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁
·Precision :
𝑇𝑃
𝑇𝑃+𝐹𝑃
·Error Rate : 1 - Accuracy
·False Positive Rate : 1 - Specificity
-> 정확도 : 맞게 예측 / 전체
-> 민감도 : 맞게 예측 / 실제 환자
-> 정밀도 : 맞게 예측 / 예측 환자
-> 특이도 : 맞게 예측 / 실제 아님
-> 오류 비율 : 1 – (정확도)
1. Confusion Matrix (혼동 행렬)
·Sensitivity(Recall, True Positive Rate) :
𝑇𝑃
𝑇𝑃+𝐹𝑁
예측
환자다 아니다
실제
환자 TP FN
아님 FP TN
·Specificity :
𝑇𝑁
𝐹𝑃+𝑇𝑁
·Accuracy :
𝑇𝑃+𝑇𝑁
𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁
·Precision :
𝑇𝑃
𝑇𝑃+𝐹𝑃
·Error Rate : 1 - Accuracy
·False Positive Rate : 1 - Specificity
-> 정확도 : 맞게 예측 / 전체
-> 민감도 : 맞게 예측 / 실제 환자
-> 정밀도 : 맞게 예측 / 예측 환자
-> 특이도 : 맞게 예측 / 실제 아님
-> 오류 비율 : 1 – (정확도)
-> FP 비율 : 1 – (특이도)
1. Confusion Matrix (혼동 행렬)
이들 중에, 아래 2가지 활용!
예측
환자다 아니다
실제
환자 TP FN
아님 FP TN
·Sensitivity(Recall, True Positive Rate) :
𝑇𝑃
𝑇𝑃+𝐹𝑁
예측
환자다 아니다
실제
환자 TP FN
아님 FP TN
-> 민감도 : 맞게 예측 / 실제 환자
[ Y 축 : 민감도]
[ X축 : ( 1- 특이도) ]
·Specificity :
𝑇𝑁
𝐹𝑃+𝑇𝑁
-> 특이도 : 맞게 예측 / 실제 아님
T N T P
F P
민감도(Sensitivity)
특이도(Specificity)
환자다(P)아니다(N)
F N
0 25 50 75 100 X
(판정값)
Y
(빈도)
[분포 그래프 해석]
1. 판정값(Test Value)에 따른
환자(P)와 아님(N)의 분포
-> 분포가 확실히 분류되는 것이
좋은 판정값
임계값(Threshold)
혹은 절단점(Cutpoint)
2. 절단점(Cutpoint) 기준으로
그 이상은 환자(P)
그 미만은 아님(N)으로 예측
-> 이 떄의 민감도
𝑇𝑃
𝑇𝑃+𝐹𝑁
와
특이도
𝑇𝑁
𝐹𝑃+𝑇𝑁
를 구할 수 있다.
2. Distribution Graph (분포 그래프)
예제 데이터 (T4 수치에 따른 갑상선 환자 분포)
T4 수치 환자 아님
5 이하 18 6
5 ~ 7 6 15
7 ~ 9 4 33
9 이상 3 43
혈중 티록신 수치
예측
5 이하 5 초과
실제
환자 18 14
아님 1 92
T4 = 5
T N T P
F PF N
T N T P
F PF N
T N T P
F PF N
T4 = 5
T4 = 7
T4 = 9
예측
7 이하 7 초과
실제
환자 25 7
아님 18 75
예측
9 이하 9 초과
실제
환자 29 3
아님 54 39
T4 = 7
T4 = 9
민감도 : 0.56
특이도 : 0.99
민감도 : 0.78
특이도 : 0.81
민감도 : 0.91
특이도 : 0.42
???
T4 수치 환자 아님
1 이하 18 6
1 ~ 2 6 15
… … …
11 ~ 12 4 33
12 이상 3 43
예측
5 이하 5 초과
실제
환자 18 14
아님 1 92
T4 = 5
T N T P
F PF N
T N T P
F PF N
T N T P
F PF N
T4 = 5
T4 = 7
T4 = 9
예측
7 이하 7 초과
실제
환자 25 7
아님 18 75
예측
9 이하 9 초과
실제
환자 29 3
아님 54 39
T4 = 7
T4 = 9
민감도 : 0.56
특이도 : 0.99
민감도 : 0.78
특이도 : 0.81민감도 : 0.91
특이도 : 0.42
F PF N
T N T P
F PF N
T4 = 7
T4 = 9
예측
9 이하 9 초과
실제
환자 29 3
아님 54 39
T4 = 9
민감도 : 0.91
특이도 : 0.42
F PF N
T N T P
F PF N
T4 = 7
T4 = 9
예측
9 이하 9 초과
실제
환자 29 3
아님 54 39
T4 = 9
민감도 : 0.91
특이도 : 0.42
F PF N
T N T P
F PF N
T4 = 7
T4 = 9
예측
9 이하 9 초과
실제
환자 29 3
아님 54 39
T4 = 9
민감도 : 0.91
특이도 : 0.42
무한정 그릴 순 없으니
그래서, ROC Curve
3. ROC Curve + AUC
T4 수치 환자 아님
1 이하 18 6
1 ~ 2 6 15
… … …
11 ~ 12 4 33
12 이상 3 43
ROC Curve : (민감도)와 (1 – 특이도)로 표현
AUC (Area Under the Curve) : ROC Curve 아래의 면적
“ ‘X 수치’ 라는 판정값이 위와 같다면, 상대적으로 ‘T4 수치’는 좋은 판정값으로 볼 수 있다. “
X 수치
a 이하
a ~ b
…
y ~ z
z 이상
T4 = 5
T4 = 7
T4 = 9
T4 수치
X 수치
4. Conclusion (결론)
판정값(Test Value)을 통한
분포가 명확히 분류 될수록
AUC의 면적이 넓어지고
좋은 판정값이라 할 수 있다!
X2
X1
T4
분류 성능 (예측 성능)
X2 < X1 < T4
THANK YOU !

More Related Content

What's hot

Densely Connected Convolutional Networks
Densely Connected Convolutional NetworksDensely Connected Convolutional Networks
Densely Connected Convolutional Networks
harmonylab
 
내가 이해하는 SVM(왜, 어떻게를 중심으로)
내가 이해하는 SVM(왜, 어떻게를 중심으로)내가 이해하는 SVM(왜, 어떻게를 중심으로)
내가 이해하는 SVM(왜, 어떻게를 중심으로)
SANG WON PARK
 
20181130 lidar object detection survey
20181130 lidar object detection survey20181130 lidar object detection survey
20181130 lidar object detection survey
Takuya Minagawa
 
Mitchell's Face Recognition
Mitchell's Face RecognitionMitchell's Face Recognition
Mitchell's Face Recognition
butest
 
コンピューテーショナルフォトグラフィ
コンピューテーショナルフォトグラフィコンピューテーショナルフォトグラフィ
コンピューテーショナルフォトグラフィ
Norishige Fukushima
 
[DL輪読会]Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
[DL輪読会]Swin Transformer: Hierarchical Vision Transformer using Shifted Windows[DL輪読会]Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
[DL輪読会]Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
Deep Learning JP
 
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근MinGeun Park
 
【DL輪読会】Investigating Tradeoffs in Real-World Video Super-Resolution
【DL輪読会】Investigating Tradeoffs in Real-World Video Super-Resolution【DL輪読会】Investigating Tradeoffs in Real-World Video Super-Resolution
【DL輪読会】Investigating Tradeoffs in Real-World Video Super-Resolution
Deep Learning JP
 
Generative Adversarial Networks GAN - Xavier Giro - UPC TelecomBCN Barcelona ...
Generative Adversarial Networks GAN - Xavier Giro - UPC TelecomBCN Barcelona ...Generative Adversarial Networks GAN - Xavier Giro - UPC TelecomBCN Barcelona ...
Generative Adversarial Networks GAN - Xavier Giro - UPC TelecomBCN Barcelona ...
Universitat Politècnica de Catalunya
 
ガイデットフィルタとその周辺
ガイデットフィルタとその周辺ガイデットフィルタとその周辺
ガイデットフィルタとその周辺Norishige Fukushima
 
[DL輪読会]YOLOv4: Optimal Speed and Accuracy of Object Detection
[DL輪読会]YOLOv4: Optimal Speed and Accuracy of Object Detection[DL輪読会]YOLOv4: Optimal Speed and Accuracy of Object Detection
[DL輪読会]YOLOv4: Optimal Speed and Accuracy of Object Detection
Deep Learning JP
 
Gpuフォトンマッピング手法 h26-09-kgussan-第2回レイトレ合宿
Gpuフォトンマッピング手法 h26-09-kgussan-第2回レイトレ合宿Gpuフォトンマッピング手法 h26-09-kgussan-第2回レイトレ合宿
Gpuフォトンマッピング手法 h26-09-kgussan-第2回レイトレ合宿
Takahiro KOGUCHI
 
Keras-community-week_Flax_and_Keras.pptx
Keras-community-week_Flax_and_Keras.pptxKeras-community-week_Flax_and_Keras.pptx
Keras-community-week_Flax_and_Keras.pptx
영빈 이
 
【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...
【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...
【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...
Deep Learning JP
 
Wasserstein GAN
Wasserstein GANWasserstein GAN
Wasserstein GAN
Bar Vinograd
 
Introduction to batch normalization
Introduction to batch normalizationIntroduction to batch normalization
Introduction to batch normalization
Jamie (Taka) Wang
 
[DL輪読会]PV-RCNN: Point-Voxel Feature Set Abstraction for 3D Object Detection
[DL輪読会]PV-RCNN: Point-Voxel Feature Set Abstraction for 3D Object Detection[DL輪読会]PV-RCNN: Point-Voxel Feature Set Abstraction for 3D Object Detection
[DL輪読会]PV-RCNN: Point-Voxel Feature Set Abstraction for 3D Object Detection
Deep Learning JP
 
ShuffleNet - PR054
ShuffleNet - PR054ShuffleNet - PR054
ShuffleNet - PR054
Jinwon Lee
 
SSII2014 チュートリアル資料
SSII2014 チュートリアル資料SSII2014 チュートリアル資料
SSII2014 チュートリアル資料Masayuki Tanaka
 
[解説スライド] NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
[解説スライド] NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis[解説スライド] NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
[解説スライド] NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
Kento Doi
 

What's hot (20)

Densely Connected Convolutional Networks
Densely Connected Convolutional NetworksDensely Connected Convolutional Networks
Densely Connected Convolutional Networks
 
내가 이해하는 SVM(왜, 어떻게를 중심으로)
내가 이해하는 SVM(왜, 어떻게를 중심으로)내가 이해하는 SVM(왜, 어떻게를 중심으로)
내가 이해하는 SVM(왜, 어떻게를 중심으로)
 
20181130 lidar object detection survey
20181130 lidar object detection survey20181130 lidar object detection survey
20181130 lidar object detection survey
 
Mitchell's Face Recognition
Mitchell's Face RecognitionMitchell's Face Recognition
Mitchell's Face Recognition
 
コンピューテーショナルフォトグラフィ
コンピューテーショナルフォトグラフィコンピューテーショナルフォトグラフィ
コンピューテーショナルフォトグラフィ
 
[DL輪読会]Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
[DL輪読会]Swin Transformer: Hierarchical Vision Transformer using Shifted Windows[DL輪読会]Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
[DL輪読会]Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
 
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
 
【DL輪読会】Investigating Tradeoffs in Real-World Video Super-Resolution
【DL輪読会】Investigating Tradeoffs in Real-World Video Super-Resolution【DL輪読会】Investigating Tradeoffs in Real-World Video Super-Resolution
【DL輪読会】Investigating Tradeoffs in Real-World Video Super-Resolution
 
Generative Adversarial Networks GAN - Xavier Giro - UPC TelecomBCN Barcelona ...
Generative Adversarial Networks GAN - Xavier Giro - UPC TelecomBCN Barcelona ...Generative Adversarial Networks GAN - Xavier Giro - UPC TelecomBCN Barcelona ...
Generative Adversarial Networks GAN - Xavier Giro - UPC TelecomBCN Barcelona ...
 
ガイデットフィルタとその周辺
ガイデットフィルタとその周辺ガイデットフィルタとその周辺
ガイデットフィルタとその周辺
 
[DL輪読会]YOLOv4: Optimal Speed and Accuracy of Object Detection
[DL輪読会]YOLOv4: Optimal Speed and Accuracy of Object Detection[DL輪読会]YOLOv4: Optimal Speed and Accuracy of Object Detection
[DL輪読会]YOLOv4: Optimal Speed and Accuracy of Object Detection
 
Gpuフォトンマッピング手法 h26-09-kgussan-第2回レイトレ合宿
Gpuフォトンマッピング手法 h26-09-kgussan-第2回レイトレ合宿Gpuフォトンマッピング手法 h26-09-kgussan-第2回レイトレ合宿
Gpuフォトンマッピング手法 h26-09-kgussan-第2回レイトレ合宿
 
Keras-community-week_Flax_and_Keras.pptx
Keras-community-week_Flax_and_Keras.pptxKeras-community-week_Flax_and_Keras.pptx
Keras-community-week_Flax_and_Keras.pptx
 
【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...
【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...
【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...
 
Wasserstein GAN
Wasserstein GANWasserstein GAN
Wasserstein GAN
 
Introduction to batch normalization
Introduction to batch normalizationIntroduction to batch normalization
Introduction to batch normalization
 
[DL輪読会]PV-RCNN: Point-Voxel Feature Set Abstraction for 3D Object Detection
[DL輪読会]PV-RCNN: Point-Voxel Feature Set Abstraction for 3D Object Detection[DL輪読会]PV-RCNN: Point-Voxel Feature Set Abstraction for 3D Object Detection
[DL輪読会]PV-RCNN: Point-Voxel Feature Set Abstraction for 3D Object Detection
 
ShuffleNet - PR054
ShuffleNet - PR054ShuffleNet - PR054
ShuffleNet - PR054
 
SSII2014 チュートリアル資料
SSII2014 チュートリアル資料SSII2014 チュートリアル資料
SSII2014 チュートリアル資料
 
[解説スライド] NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
[解説スライド] NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis[解説スライド] NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
[解説スライド] NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
 

Confusion Matrix(혼동행렬) & ROC Curve (+ AUC)

  • 2. Contents 1. Confusion Matrix 2. Distribution Graph 4. Conclusion 3. ROC Curve + AUC
  • 3. ·Sensitivity(Recall, True Positive Rate) : 𝑇𝑃 𝑇𝑃+𝐹𝑁 1. Confusion Matrix Prediction Positive Negative Actual Positive TP FN Negative FP TN ·Specificity : 𝑇𝑁 𝐹𝑃+𝑇𝑁 ·Accuracy : 𝑇𝑃+𝑇𝑁 𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁 ·Precision : 𝑇𝑃 𝑇𝑃+𝐹𝑃 ·Error Rate : 1 - Accuracy ·False Positive Rate : 1 - Specificity 어우..
  • 5. 예측 환자다(P) 아니다(N) 실제 환자 TP FN 아님 FP TN ·TP : True Positive, 예측 P, 실제도 P ·FP : False Positive, 예측 P, 실제는 N ·TN : True Negative, 예측 N, 실제도 N ·FN : True Negative, 예측 N, 실제는 P 맞음! 틀림! 예측이! 예측이! -> 예측(P/N)을 기준으로 두고, True/False 를 맞음/틀림 으로 접근! 하기 전에, 잠깐!
  • 6. ·Sensitivity(Recall, True Positive Rate) : 𝑇𝑃 𝑇𝑃+𝐹𝑁 1. Confusion Matrix (혼동 행렬) 예측 환자다 아니다 실제 환자 TP FN 아님 FP TN ·Specificity : 𝑇𝑁 𝐹𝑃+𝑇𝑁 ·Accuracy : 𝑇𝑃+𝑇𝑁 𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁 ·Precision : 𝑇𝑃 𝑇𝑃+𝐹𝑃 ·Error Rate : 1 - Accuracy ·False Positive Rate : 1 - Specificity -> 정확도 : 맞게 예측 / 전체
  • 7. ·Sensitivity(Recall, True Positive Rate) : 𝑇𝑃 𝑇𝑃+𝐹𝑁 예측 환자다 아니다 실제 환자 TP FN 아님 FP TN ·Specificity : 𝑇𝑁 𝐹𝑃+𝑇𝑁 ·Accuracy : 𝑇𝑃+𝑇𝑁 𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁 ·Precision : 𝑇𝑃 𝑇𝑃+𝐹𝑃 ·Error Rate : 1 - Accuracy ·False Positive Rate : 1 - Specificity -> 정확도 : 맞게 예측 / 전체 -> 민감도 : 맞게 예측 / 실제 환자 1. Confusion Matrix (혼동 행렬)
  • 8. ·Sensitivity(Recall, True Positive Rate) : 𝑇𝑃 𝑇𝑃+𝐹𝑁 예측 환자다 아니다 실제 환자 TP FN 아님 FP TN ·Specificity : 𝑇𝑁 𝐹𝑃+𝑇𝑁 ·Accuracy : 𝑇𝑃+𝑇𝑁 𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁 ·Precision : 𝑇𝑃 𝑇𝑃+𝐹𝑃 ·Error Rate : 1 - Accuracy ·False Positive Rate : 1 - Specificity -> 정확도 : 맞게 예측 / 전체 -> 민감도 : 맞게 예측 / 실제 환자 -> 정밀도 : 맞게 예측 / 예측 환자 1. Confusion Matrix (혼동 행렬)
  • 9. ·Sensitivity(Recall, True Positive Rate) : 𝑇𝑃 𝑇𝑃+𝐹𝑁 예측 환자다 아니다 실제 환자 TP FN 아님 FP TN ·Specificity : 𝑇𝑁 𝐹𝑃+𝑇𝑁 ·Accuracy : 𝑇𝑃+𝑇𝑁 𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁 ·Precision : 𝑇𝑃 𝑇𝑃+𝐹𝑃 ·Error Rate : 1 - Accuracy ·False Positive Rate : 1 - Specificity -> 정확도 : 맞게 예측 / 전체 -> 민감도 : 맞게 예측 / 실제 환자 -> 정밀도 : 맞게 예측 / 예측 환자 -> 특이도 : 맞게 예측 / 실제 아님 1. Confusion Matrix (혼동 행렬)
  • 10. ·Sensitivity(Recall, True Positive Rate) : 𝑇𝑃 𝑇𝑃+𝐹𝑁 예측 환자다 아니다 실제 환자 TP FN 아님 FP TN ·Specificity : 𝑇𝑁 𝐹𝑃+𝑇𝑁 ·Accuracy : 𝑇𝑃+𝑇𝑁 𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁 ·Precision : 𝑇𝑃 𝑇𝑃+𝐹𝑃 ·Error Rate : 1 - Accuracy ·False Positive Rate : 1 - Specificity -> 정확도 : 맞게 예측 / 전체 -> 민감도 : 맞게 예측 / 실제 환자 -> 정밀도 : 맞게 예측 / 예측 환자 -> 특이도 : 맞게 예측 / 실제 아님 -> 오류 비율 : 1 – (정확도) 1. Confusion Matrix (혼동 행렬)
  • 11. ·Sensitivity(Recall, True Positive Rate) : 𝑇𝑃 𝑇𝑃+𝐹𝑁 예측 환자다 아니다 실제 환자 TP FN 아님 FP TN ·Specificity : 𝑇𝑁 𝐹𝑃+𝑇𝑁 ·Accuracy : 𝑇𝑃+𝑇𝑁 𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁 ·Precision : 𝑇𝑃 𝑇𝑃+𝐹𝑃 ·Error Rate : 1 - Accuracy ·False Positive Rate : 1 - Specificity -> 정확도 : 맞게 예측 / 전체 -> 민감도 : 맞게 예측 / 실제 환자 -> 정밀도 : 맞게 예측 / 예측 환자 -> 특이도 : 맞게 예측 / 실제 아님 -> 오류 비율 : 1 – (정확도) -> FP 비율 : 1 – (특이도) 1. Confusion Matrix (혼동 행렬)
  • 12. 이들 중에, 아래 2가지 활용! 예측 환자다 아니다 실제 환자 TP FN 아님 FP TN ·Sensitivity(Recall, True Positive Rate) : 𝑇𝑃 𝑇𝑃+𝐹𝑁 예측 환자다 아니다 실제 환자 TP FN 아님 FP TN -> 민감도 : 맞게 예측 / 실제 환자 [ Y 축 : 민감도] [ X축 : ( 1- 특이도) ] ·Specificity : 𝑇𝑁 𝐹𝑃+𝑇𝑁 -> 특이도 : 맞게 예측 / 실제 아님
  • 13. T N T P F P 민감도(Sensitivity) 특이도(Specificity) 환자다(P)아니다(N) F N 0 25 50 75 100 X (판정값) Y (빈도) [분포 그래프 해석] 1. 판정값(Test Value)에 따른 환자(P)와 아님(N)의 분포 -> 분포가 확실히 분류되는 것이 좋은 판정값 임계값(Threshold) 혹은 절단점(Cutpoint) 2. 절단점(Cutpoint) 기준으로 그 이상은 환자(P) 그 미만은 아님(N)으로 예측 -> 이 떄의 민감도 𝑇𝑃 𝑇𝑃+𝐹𝑁 와 특이도 𝑇𝑁 𝐹𝑃+𝑇𝑁 를 구할 수 있다. 2. Distribution Graph (분포 그래프)
  • 14. 예제 데이터 (T4 수치에 따른 갑상선 환자 분포) T4 수치 환자 아님 5 이하 18 6 5 ~ 7 6 15 7 ~ 9 4 33 9 이상 3 43 혈중 티록신 수치 예측 5 이하 5 초과 실제 환자 18 14 아님 1 92 T4 = 5 T N T P F PF N T N T P F PF N T N T P F PF N T4 = 5 T4 = 7 T4 = 9 예측 7 이하 7 초과 실제 환자 25 7 아님 18 75 예측 9 이하 9 초과 실제 환자 29 3 아님 54 39 T4 = 7 T4 = 9 민감도 : 0.56 특이도 : 0.99 민감도 : 0.78 특이도 : 0.81 민감도 : 0.91 특이도 : 0.42
  • 15. ??? T4 수치 환자 아님 1 이하 18 6 1 ~ 2 6 15 … … … 11 ~ 12 4 33 12 이상 3 43 예측 5 이하 5 초과 실제 환자 18 14 아님 1 92 T4 = 5 T N T P F PF N T N T P F PF N T N T P F PF N T4 = 5 T4 = 7 T4 = 9 예측 7 이하 7 초과 실제 환자 25 7 아님 18 75 예측 9 이하 9 초과 실제 환자 29 3 아님 54 39 T4 = 7 T4 = 9 민감도 : 0.56 특이도 : 0.99 민감도 : 0.78 특이도 : 0.81민감도 : 0.91 특이도 : 0.42 F PF N T N T P F PF N T4 = 7 T4 = 9 예측 9 이하 9 초과 실제 환자 29 3 아님 54 39 T4 = 9 민감도 : 0.91 특이도 : 0.42 F PF N T N T P F PF N T4 = 7 T4 = 9 예측 9 이하 9 초과 실제 환자 29 3 아님 54 39 T4 = 9 민감도 : 0.91 특이도 : 0.42 F PF N T N T P F PF N T4 = 7 T4 = 9 예측 9 이하 9 초과 실제 환자 29 3 아님 54 39 T4 = 9 민감도 : 0.91 특이도 : 0.42
  • 16. 무한정 그릴 순 없으니
  • 18. 3. ROC Curve + AUC T4 수치 환자 아님 1 이하 18 6 1 ~ 2 6 15 … … … 11 ~ 12 4 33 12 이상 3 43 ROC Curve : (민감도)와 (1 – 특이도)로 표현 AUC (Area Under the Curve) : ROC Curve 아래의 면적 “ ‘X 수치’ 라는 판정값이 위와 같다면, 상대적으로 ‘T4 수치’는 좋은 판정값으로 볼 수 있다. “ X 수치 a 이하 a ~ b … y ~ z z 이상 T4 = 5 T4 = 7 T4 = 9 T4 수치 X 수치
  • 19. 4. Conclusion (결론) 판정값(Test Value)을 통한 분포가 명확히 분류 될수록 AUC의 면적이 넓어지고 좋은 판정값이라 할 수 있다! X2 X1 T4 분류 성능 (예측 성능) X2 < X1 < T4