BaşlayınÜcretsiz Başlayın

Detecting outliers with IForest

IForest is a robust estimator and only requires a few lines of code to detect outliers from any dataset. You may find that this syntax looks familiar since it closely resembles sklearn syntax.

The full version of the Big Mart Sales data has been loaded for you as big_mart, which you can explore in the console.

Bu egzersiz

Anomaly Detection in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Import the IForest estimator from pyod.
  • Initialize an IForest() with default parameters.
  • Fit the estimator and generate predictions on the big_mart simultaneously, and store the results in labels.
  • Use pandas subsetting to filter out the outliers from big_mart.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import IForest from pyod
from pyod.____ import ____

# Initialize an instance with default parameters
iforest = ____

# Generate outlier labels
labels = ____

# Filter big_mart for outliers
outliers = ____

print(outliers.shape)
Kodu Düzenle ve Çalıştır