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

bookChallenge: One-Class SVM for Novelty Detection

Завдання

Swipe to start coding

You are given a 2D dataset of normal points and a few anomalies. Your task is to train a One-Class SVM model to detect novelties, visualize prediction results, and print anomaly proportions.

Follow these steps:

  1. Import and initialize OneClassSVM from sklearn.svm.
    • Use kernel='rbf', gamma=0.1, nu=0.05.
  2. Fit the model on normal data only (X_train).
  3. Predict labels for test data (X_test).
    • Label meaning: 1 → normal, -1 → novel/anomalous.
  4. Compute the fraction of anomalies in X_test.
  5. Print:
    • Shapes of train/test sets.
    • Number and fraction of anomalies detected.

Рішення

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

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

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

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

single

Запитати АІ

expand

Запитати АІ

ChatGPT

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

close

Awesome!

Completion rate improved to 4.55

bookChallenge: One-Class SVM for Novelty Detection

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

Завдання

Swipe to start coding

You are given a 2D dataset of normal points and a few anomalies. Your task is to train a One-Class SVM model to detect novelties, visualize prediction results, and print anomaly proportions.

Follow these steps:

  1. Import and initialize OneClassSVM from sklearn.svm.
    • Use kernel='rbf', gamma=0.1, nu=0.05.
  2. Fit the model on normal data only (X_train).
  3. Predict labels for test data (X_test).
    • Label meaning: 1 → normal, -1 → novel/anomalous.
  4. Compute the fraction of anomalies in X_test.
  5. Print:
    • Shapes of train/test sets.
    • Number and fraction of anomalies detected.

Рішення

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

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

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

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

single

some-alt