Designing Machine Learning Workflows in Python
Dr. Chris Anagnostopoulos
Honorary Associate Professor
Supervised
Unsupervised
Careful use of a handful of labels:
from sklearn.neighbors import
LocalOutlierFactor as lof
clf = lof()
y_pred = clf.fit_predict(X)
y_pred[:4]
array([ 1, 1, 1, -1])
clf.negative_outlier_factor_[:4]
array([-0.99, -1.02, -1.08 , -0.97])
confusion_matrix(
y_pred, ground_truth)
array([[ 5, 16],
[ 0, 184]])
clf = lof(contamination=0.02)
y_pred = clf.fit_predict(X)
confusion_matrix(
y_pred, ground_truth)
array([[ 5, 0],
[ 0, 200]])
Designing Machine Learning Workflows in Python