Medindo desempenho

Introduction to Anomaly Detection in R

Alastair Rushworth

Data Scientist

Usando um limiar de decisão

Escolher um valor alto

high_score <- quantile(sat$score, probs = 0.99)
high_score
    99% 
0.6228078

Binarizar score

sat$binary_score <- as.numeric(score >= high_score)
Introduction to Anomaly Detection in R

Tabelas de concordância

Comparando rótulo verdadeiro e score binarizado

table(sat$label, sat$binary_score)
       0    1
  0 5729    3
  1   15   56

  • 56 de 71 anomalias encontradas
Introduction to Anomaly Detection in R

Recall

Anomalias corretamente identificadas $\div$ Total de anomalias

  • 1 = Recall perfeito; toda anomalia detectada pelo algoritmo
table(sat$label, sat$binary_score)
       0    1
  0 5729    3
  1   15   56
recall <- 56 / (15 + 56)
recall
0.7887324
Introduction to Anomaly Detection in R

Precisão

Anomalias corretamente identificadas $\mathbf{\div}$ Total marcado como anomalia

  • 1 = Precisão perfeita; nenhuma instância normal rotulada incorretamente
table(sat$label, sat$binary_score)
       0    1
  0 5729    3
  1   15   56
precision <- 56 / (56 + 3)
precision
0.9491525
Introduction to Anomaly Detection in R

Vamos praticar!

Introduction to Anomaly Detection in R

Preparing Video For Download...