Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Isolation Forest Implementation | Isolation-Based Methods
Outlier and Novelty Detection in Practice

bookChallenge: Isolation Forest Implementation

Завдання

Swipe to start coding

You are given a 2D dataset containing normal points and a few outliers. Your goal is to train an Isolation Forest model to detect anomalies, compute anomaly scores, and flag potential outliers.

Steps:

  1. Import and initialize IsolationForest from sklearn.ensemble.
  2. Fit the model on the dataset X.
  3. Compute anomaly scores using decision_function(X).
  4. Predict labels using .predict(X) — note:
    • 1 → inlier
    • -1 → outlier
  5. Print the number of detected outliers and show example scores.
  6. Use parameters: contamination=0.15, random_state=42, and n_estimators=100.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 4
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Suggested prompts:

Can you explain this in simpler terms?

What are some examples related to this topic?

Where can I learn more about this?

close

Awesome!

Completion rate improved to 4.55

bookChallenge: Isolation Forest Implementation

Свайпніть щоб показати меню

Завдання

Swipe to start coding

You are given a 2D dataset containing normal points and a few outliers. Your goal is to train an Isolation Forest model to detect anomalies, compute anomaly scores, and flag potential outliers.

Steps:

  1. Import and initialize IsolationForest from sklearn.ensemble.
  2. Fit the model on the dataset X.
  3. Compute anomaly scores using decision_function(X).
  4. Predict labels using .predict(X) — note:
    • 1 → inlier
    • -1 → outlier
  5. Print the number of detected outliers and show example scores.
  6. Use parameters: contamination=0.15, random_state=42, and n_estimators=100.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 4
single

single

some-alt