In [1]:
from sklearn.metrics import precision_score
In [2]:
y_true = [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
y_pred = [0, 1, 1, 1, 1, 0, 0, 0, 1, 1]
In [3]:
print(precision_score(y_true, y_pred))