R로 시작하는 이상치 탐지 입문
Alastair Rushworth
Data Scientist
높은 임계값 선택
high_score <- quantile(sat$score, probs = 0.99)
high_score
99%
0.6228078
점수 이진화
sat$binary_score <- as.numeric(score >= high_score)
실제 라벨과 이진화 점수 비교
table(sat$label, sat$binary_score)
0 1
0 5729 3
1 15 56
정답으로 식별한 이상치 $\div$ 전체 이상치
table(sat$label, sat$binary_score)
0 1
0 5729 3
1 15 56
recall <- 56 / (15 + 56)
recall
0.7887324
정답으로 식별한 이상치 $\mathbf{\div}$ 이상치로 분류된 전체 건수
table(sat$label, sat$binary_score)
0 1
0 5729 3
1 15 56
precision <- 56 / (56 + 3)
precision
0.9491525
R로 시작하는 이상치 탐지 입문