Exercises
Complete the following exercises for some practice with the machine learning workflow and exposure to some additional anomaly detection strategies:
- A one-class SVM is another model that can be used for unsupervised outlier detection. Build a one-class SVM with the default parameters, using a pipeline with a
StandardScaler
object followed by aOneClassSVM
object. Train the model on the January 2018 data, just as we did for the isolation forest. Make predictions on that same data. Count the number of inliers and outliers this model identifies. - Using the 2018 minutely data, build a k-means model with two clusters after standardizing the data with a
StandardScaler
object. With the labeled data in theattacks
table in the SQLite database (logs/logs.db
), see whether this model gets a good Fowlkes-Mallows score (use thefowlkes_mallows_score()
function insklearn.metrics
). - Evaluate the performance of a random forest classifier for supervised anomaly detection. Set...