Overzicht van hyperparameters van Isolation Forest

Anomaly Detection in Python

Bekhruz (Bex) Tuychiev

Kaggle Master, Data Science Content Creator

Belangrijkste hyperparameters

Hyperparameters die IForest het meest beïnvloeden:

  • contamination
  • n_estimators
  • max_samples
  • max_features
Anomaly Detection in Python

Wat is contamination?

Hoe IForest datapunten classificeert:

  1. Rauwe anomalie-scores worden gegenereerd
  2. Stel een drempel in: contamination
  3. Het hoogste percentage scores, bepaald door contamination, wordt als outliers gemarkeerd
Anomaly Detection in Python

Contamination instellen

from pyod.models.iforest import IForest


# Accepts a value between 0 and 0.5 iforest = IForest(contamination=0.05)
Anomaly Detection in Python

Wat is n_estimators?

# More trees for larger datasets
iforest = IForest(n_estimators=1000)

iforest.fit(airbnb_df)
Anomaly Detection in Python

max_samples en max_features

iforest = IForest(n_estimators=200, max_samples=0.6, max_features=0.9)


iforest.fit(airbnb_df)
Anomaly Detection in Python

Boomgroei

  • iTrees:
    • groeien willekeurig
    • splitsing willekeurig gekozen tussen min en max van feature
    • groeien tot:
      • alle punten geïsoleerd zijn
      • maximale diepte is bereikt
Anomaly Detection in Python

Maximale boomdiepte

  • Gelijk aan de logaritme van de steekproefgrootte
Anomaly Detection in Python

Voordelen van IForest

  • Zeer efficiënt op grote datasets
  • Heeft niet alle normale gevallen nodig zoals andere algoritmen
  • Geen statistische aannames
  • Werkt vaak goed out-of-the-box
Anomaly Detection in Python

Uitdagingen bij outlierdetectie

  • Supervised-modellen steunen op metrics zoals RMSE of log loss
  • Outlierdetectie is een unsupervised probleem
  • Outlier-classifiers combineren met supervised-modellen
Anomaly Detection in Python

Laten we oefenen!

Anomaly Detection in Python

Preparing Video For Download...