CommencerCommencer gratuitement

Three novelty detectors

Finally, you know enough to run some tests on the use of a few anomaly detectors on the arrhythmia dataset. To test their performance, you will train them on an unlabeled training dataset, but then compare their predictions to the ground truth on the test data using their method .score_samples(). This time, you will be asked to import the detectors as part of the exercise, but you do have the data X_train, X_test, y_train, y_test preloaded as usual.

Cet exercice fait partie du cours

Designing Machine Learning Workflows in Python

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Import the novelty detector
from sklearn.____ import ____ as onesvm

# Fit it to the training data and score the test data
svm_detector = ____.____(X_train)
scores = svm_detector.____(X_test)
Modifier et exécuter le code