Wanderer
Wanderer

Reputation: 1197

precision_recall_fscore_support return the same value precision recall

I am using precision_recall_fscore_support from sklearn to calculate the micro-precision, and micro-recall.

The problem is that the function returns the exact same value for both of them. It is a multi-class classification problem and I am not sure what went wrong.

Here is the code:

t = precision_recall_fscore_support(y_test, classifier.predict(x_test), average='micro')
print(t)

Here is the output:

Micro accuracy: (0.3359375, 0.3359375, 0.3359375, None)

Upvotes: 2

Views: 2559

Answers (1)

Stev
Stev

Reputation: 1140

What are you expecting to see? In section 3.3.2.8.2. of the documentation, here, it states “micro”-averaging in a multiclass setting with all labels included will produce equal precision, recall and F", and suggests you should try average = "weighted".

Here is a similar complaint on Scikit-learn's Github.

Upvotes: 5

Related Questions