Misurare le prestazioni

Introduzione all'Anomaly Detection in R

Alastair Rushworth

Data Scientist

Uso di una soglia di decisione

Scegli un valore alto

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

Binarizza score

sat$binary_score <- as.numeric(score >= high_score)
Introduzione all'Anomaly Detection in R

Tabelle di concordanza

Confronto tra etichetta reale e score binarizzato

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

  • 56 su 71 anomalie trovate
Introduzione all'Anomaly Detection in R

Recall

Anomalie identificate correttamente $\div$ Totale anomalie

  • 1 = Richiamo perfetto; ogni anomalia rilevata dall'algoritmo
table(sat$label, sat$binary_score)
       0    1
  0 5729    3
  1   15   56
recall <- 56 / (15 + 56)
recall
0.7887324
Introduzione all'Anomaly Detection in R

Precisione

Anomalie identificate correttamente $\mathbf{\div}$ Totale segnate come anomale

  • 1 = Precisione perfetta; nessun normale etichettato per errore
table(sat$label, sat$binary_score)
       0    1
  0 5729    3
  1   15   56
precision <- 56 / (56 + 3)
precision
0.9491525
Introduzione all'Anomaly Detection in R

Facciamo pratica!

Introduzione all'Anomaly Detection in R

Preparing Video For Download...