Memvisualisasikan skor isolasi

Pengantar Deteksi Anomali di R

Alastair Rushworth

Data Scientist

Deret nilai

h_seq <- seq(min(furniture$Height), max(furniture$Height), length.out = 20)

w_seq <- seq(min(furniture$Width),  max(furniture$Width),  length.out = 20)

 

Argumen seq()

  • from - batas atas
  • to - batas bawah
  • length.out - jumlah nilai dalam deret
Pengantar Deteksi Anomali di R

Membangun grid

furniture_grid <- expand.grid(Width = w_seq, Height = h_seq)

head(furniture_grid)
     Width Height  
1 46.85100 44.359 
2 51.48663 44.359 
3 56.12225 44.359 
4 60.75788 44.359 
5 65.39351 44.359 
6 70.02913 44.359 
Pengantar Deteksi Anomali di R

Memberi skor pada grid

furniture_grid$score <- predict(furniture_forest, furniture_grid)
Pengantar Deteksi Anomali di R

Buat contour plot!

library(lattice)
contourplot(score ~ Height + Width, data = furniture_grid, 
            region = TRUE)

Pengantar Deteksi Anomali di R

Ayo berlatih!

Pengantar Deteksi Anomali di R

Preparing Video For Download...