notebook.community
Edit and run
In [1]: from sklearn.metrics import f1_score
from sklearn.metrics import f1_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]
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(f1_score(y_true, y_pred))
print(f1_score(y_true, y_pred))
0.3636363636363636