Introduction to Anomaly Detection in R
Alastair Rushworth
Data Scientist
head(sat, 5)
label V1 V2 V3 V4 V5
1 0 92 115 120 94 84
2 0 84 102 106 79 84
3 0 84 102 102 83 80
4 0 80 102 102 79 84
5 0 84 94 102 79 80
table(sat$label)
0 1
5732 71
Cotton crop image proportion:
71 / 5803
0.01223505
plot(V2 ~ V3, data = sat, col = as.factor(label), pch = 20)
sat_for <- iForest(sat[, -1], nt = 100) sat$score <- predict(sat_for, features)
boxplot(score ~ label, data = sat, col = "olivedrab4")
Example 1: Detecting rare disease cases
Example 2: Credit card fraud
Introduction to Anomaly Detection in R