Mäta prestanda

Introduktion till avvikelsedetektering i R

Alastair Rushworth

Data Scientist

Använda en beslutströskel

Välj ett högt värde

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

Binarisera poäng

sat$binary_score <- as.numeric(score >= high_score)
Introduktion till avvikelsedetektering i R

Överensstämmelsetabeller

Jämför sann etikett och binariserad poäng

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

  • 56 av 71 avvikelser hittades
Introduktion till avvikelsedetektering i R

Recall

Korrekt identifierade avvikelser $\div$ Totalt antal avvikelser

  • 1 = Perfekt recall; varje avvikelse detekteras av algoritmen
table(sat$label, sat$binary_score)
       0    1
  0 5729    3
  1   15   56
recall <- 56 / (15 + 56)
recall
0.7887324
Introduktion till avvikelsedetektering i R

Precision

Korrekt identifierade avvikelser $\mathbf{\div}$ Totalt klassificerade som avvikande

  • 1 = Perfekt precision; inga normala instanser felmärkta
table(sat$label, sat$binary_score)
       0    1
  0 5729    3
  1   15   56
precision <- 56 / (56 + 3)
precision
0.9491525
Introduktion till avvikelsedetektering i R

Nu kör vi en övning!

Introduktion till avvikelsedetektering i R

Preparing Video For Download...