jsqs
jsqs

Reputation: 51

precision, recall, F1 metrics exclude a label sklearn

I have a classifier for a NER task, and since 'O' labels are by far more than all others, I want to exclude it in metrics calculation.

I want to compute macro and micro scores with sklearn package. Macro scores can be calculated with precision_recall_fscore_support, because it returns the precision, recall, F1 and support for each label separetly.

Can I use sklearn package to compute and micro scores as well?

Upvotes: 1

Views: 776

Answers (1)

jsqs
jsqs

Reputation: 51

The answer turns out to be very simple. The label parameter of the function determines which labels to include in scores calculation. It is also combined with the macro, micro averages.

Upvotes: 1

Related Questions