ComenzarEmpieza gratis

LoF contamination

Your medical advisor at the arrhythmia startup informs you that your training data might not contain all possible types of arrhythmia. How on earth will you detect these other types without any labeled examples? Could an anomaly detector tell the difference between healthy and unhealthy without access to labels? But first, you experiment with the contamination parameter to see its effect on the confusion matrix. You have LocalOutlierFactor as lof, numpy as np, the labels as ground_truth encoded in -1and 1 just like local outlier factor output, and the unlabeled training data as X.

Este ejercicio forma parte del curso

Designing Machine Learning Workflows in Python

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

# Fit the local outlier factor and output predictions
preds = lof().____(X)

# Print the confusion matrix
print(____(ground_truth, preds))
Editar y ejecutar código