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.
This exercise is part of the course
Designing Machine Learning Workflows in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample 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)