python - What is "The sum of true positives and false positives are equal to zero for some labels." mean? -
python - What is "The sum of true positives and false positives are equal to zero for some labels." mean? -
i'm using scikit larn perform cross validation using stratifiedkfold compute f1 score, says of labels have sum of true positives , false positives equal 0 labels. thought using stratifiedkfold should prevent this? why getting problem?
also, there way confusion matrix cross_val_score function?
your classifier classifying info points negative, there no positives. can check case looking @ confusion matrix (docs , illustration here). it's hard tell happening without info info , selection of classifier, mutual causes include:
bug in code. check training info contains negative info points, , these info points contain non-zero features.
inappropriate classifier parameters. if using naive bayes, check class biases. if using svm, seek using grid search on parameter values.
the sklearn classification_report function may come in handy (docs).
re sec question: stratification ensures each fold contains roughly same proportion of info points classes. not mean classifier perform sensibly.
update:
in classification task (and when class imbalance present) trading off precision recall. depending on application, can set classifier of time (i.e. high accuracy) or can observe few points care (i.e. high recall of smaller classes). example, if task forwards back upwards emails right department, want high accuracy. acceptable misclassify kind of email 1 time year, because upset 1 person. if task observe posts sexual predators on children's forum, not want miss of them, if cost few posts incorrectly flagged. bottom line: should optimise application.
are micro or macro averaging recall? in former case, more weight given frequent classes (which similar optimising accuracy), , in latter classes have same weight.
python machine-learning scikit-learn
Comments
Post a Comment