Skip to content

Instantly share code, notes, and snippets.

View csazevedo's full-sized avatar

Carlos Azevedo csazevedo

  • Lisbon, Portugal
View GitHub Profile
@csazevedo
csazevedo / sample_cm.py
Last active March 29, 2020 22:17
example on computing the confusion matrix using sklearn
import numpy as np
from sklearn.metrics import confusion_matrix
# The true labels we have in the plot orange:positive, blue:negative
true_label = np.array(
[0., 0., 0., 0., 0.,
0., 0., 0., 0., 0.,
1., 1., 1., 1., 1.,
1., 1., 1., 1., 1.])