简体   繁体   中英

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM