Prestaties meten

Introductie tot anomaliedetectie in R

Alastair Rushworth

Data Scientist

Een drempel gebruiken

Kies een hoge drempel

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

Binariseer score

sat$binary_score <- as.numeric(score >= high_score)
Introductie tot anomaliedetectie in R

Overeenstemmingstabellen

Vergelijk echte label met gebinariseerde score

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

  • 56 van 71 anomalieën gevonden
Introductie tot anomaliedetectie in R

Recall

Correct gevonden anomalieën $\div$ Totaal aantal anomalieën

  • 1 = Perfecte recall; elke anomalie gedetecteerd
table(sat$label, sat$binary_score)
       0    1
  0 5729    3
  1   15   56
recall <- 56 / (15 + 56)
recall
0.7887324
Introductie tot anomaliedetectie in R

Precisie

Correct gevonden anomalieën $\mathbf{\div}$ Totaal als anomalie bestempeld

  • 1 = Perfecte precisie; geen normale gevallen fout gelabeld
table(sat$label, sat$binary_score)
       0    1
  0 5729    3
  1   15   56
precision <- 56 / (56 + 3)
precision
0.9491525
Introductie tot anomaliedetectie in R

Laten we oefenen!

Introductie tot anomaliedetectie in R

Preparing Video For Download...