Rで学ぶ異常検知入門
Alastair Rushworth
Data Scientist
グローバル vs ローカル な異常

家具データでLOFを計算する
library(dbscan)
furniture_lof <- lof(scale(furniture), k = 5)
スコアを確認
furniture_lof[1:10]
[1] 1.0649669 1.1071205 0.9980290 1.0392385 0.9725305
[6] 1.1933199 1.3210459 1.1409659 1.0613144 1.0805445
LOFは密度の比
大きなLOFはより孤立した点を示す
furniture$score_lof <- furniture_lofplot(Width ~ Height, data = furniture, cex = score_lof, pch = 20)

Rで学ぶ異常検知入門