简体   繁体   中英

Sklearn Precision and recall giving wrong values

在此处输入图片说明

Why is my precision score so low in the above image?

I see in your comments that you're trying to interpret confusion_matrix as [[tp, fp], [fn, tn]]

Based on documentation , sklearn.confusion_matrix is a function that returns an array of:

[[tn, fp], [fn, tp]]

So, it's vice-versa and the calculation is right:

397 / (397 + 925) = 0.30030257...

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