# F1_score(average='micro') is equal to calculating accuracy for multiclasification

Is f1_score(average='micro') always the same as calculating the accuracy. Or it is just in this case?

I have tried with different values and they gave the same answer but I don't have the analytical demonstration.

from sklearn.metrics import accuracy_score
from sklearn.metrics import f1_score

y_true = [0, 1, 2, 0, 1, 2]
y_pred = [0, 2, 1, 0, 0, 1]
print(f1_score(y_true, y_pred, average='micro'))
print(accuracy_score(y_true,y_pred))

# 0.3333333
# 0.3333333