小编Joh*_*nti的帖子

如何在多类分类中为每个类计算F1度量?

我使用SciKit作为库来处理分类算法,如:NB,SVM.

这是" SPAMHAM " 电子邮件的一个非常好的和精细的二进制分类实现:

    confusion += confusion_matrix(test_y, predictions)
    score = f1_score(test_y, predictions, pos_label=SPAM)
   //note in my case 3-classes I do not need to set [pos_label]
Run Code Online (Sandbox Code Playgroud)

如果我有三个类,如{SPAM,HAM,NORMAL}而不是两个,那么:我如何调整该代码以找到每个类的F1-Score以及所有类的平均值.

computer-science machine-learning nltk text-classification

1
推荐指数
1
解决办法
548
查看次数