Visualiser le score d'isolement

Introduction à la détection d'anomalies en R

Alastair Rushworth

Data Scientist

Séquences de valeurs

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

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

 

Arguments de seq()

  • from - borne supérieure
  • to - borne inférieure
  • length.out - nombre de valeurs dans la séquence
Introduction à la détection d'anomalies en R

Construire une grille

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 
Introduction à la détection d'anomalies en R

Attribuer un score à la grille

furniture_grid$score <- predict(furniture_forest, furniture_grid)
Introduction à la détection d'anomalies en R

Tracer la carte de contours

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

Introduction à la détection d'anomalies en R

Passons à la pratique !

Introduction à la détection d'anomalies en R

Preparing Video For Download...