Isoleringsträd

Introduktion till avvikelsedetektering i R

Alastair Rushworth

Data Scientist

Isoleringsträd

Introduktion till avvikelsedetektering i R

Isoleringsträdsplot

Introduktion till avvikelsedetektering i R

Anpassa ett isoleringsträd

library(isofor)

furniture_tree <- iForest(data = furniture, nt = 1)

iForest() – argument

  • data - dataram
  • nt - antal isoleringsträd att bygga

 

 

Package download from https://github.com/Zelazny7/isofor

Introduktion till avvikelsedetektering i R

Generera ett isoleringspoäng

furniture_score <- predict(furniture_tree, newdata = furniture)

predict() – argument

  • object - en anpassad iForest-modell
  • newdata - data att poängsätta
Introduktion till avvikelsedetektering i R

Tolka isoleringspoänget

furniture_score[1:10]
[1] 0.5820092 0.5820092 0.5439338 0.5820092 0.5439338 
[6] 0.5820092 0.7129862 0.5363547 0.5363547 0.5363547

Standardiserad sökvägslängd

  • Poäng mellan 0 och 1
  • Poäng nära 1 indikerar avvikelser (kort sökvägslängd)
Introduktion till avvikelsedetektering i R

Nu kör vi en övning!

Introduktion till avvikelsedetektering i R

Preparing Video For Download...