Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UndefinedMetricWarning: No positive samples in y_true, true positive value should be meaningless UndefinedMetricWarning)

I got this warning

UndefinedMetricWarning: No positive samples in y_true, true positive value should be meaningless UndefinedMetricWarning)

Do you have any idea what it means?

like image 391
pierre Avatar asked Jan 08 '19 21:01

pierre


1 Answers

This means that all the values in y_true are zeros, which means there is no positive class records in the given dataset.

Try the following to understand the distribution of classes in your dataset.

from collections import Counter
Counter(y_true) # y_true must be your labels
like image 199
Venkatachalam Avatar answered Oct 23 '22 09:10

Venkatachalam