1
$\begingroup$

I know there is f1_score metric to get all types of F1 scores (micro, macro, and weighted); however, I would like to be able to print micro averaged F1 score using classification_report of scikit-learn. By default, it seems to be returning weighted micro averaged F1. But I would like the micro averaged F1 in the classification_report. How do I do that?

Also, I know the difference in the formula between weighted and microaverages, but what are the instances where one would be preferred over other? And, what information do they convey?

$\endgroup$
1
  • 2
    $\begingroup$ The classification_report function isn't very configurable.. usually I just write my own functions for printing classification results - call the appropiate metric functions from sklearn.metrics and print their results.. $\endgroup$
    – stmax
    Jul 15, 2016 at 9:13

1 Answer 1

2
$\begingroup$

Scikit-learn's classification report has micro averaged F1 score:

Micro average (averaging the total true positives, false negatives and false positives) is only shown for multi-label or multi-class with a subset of classes, because it corresponds to accuracy otherwise and would be the same for all metrics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.