我是python和机器学习的新手。根据我的要求,我正在尝试对数据集使用朴素贝叶斯算法。
我能够找出准确度,但尝试找出准确度并回想一下。但是,它引发以下错误:
"choose another average setting." % y_type)
ValueError: Target is multiclass but average='binary'. Please choose another average setting.
Run Code Online (Sandbox Code Playgroud)
谁能建议我如何进行。我曾尝试在平均值和召回率分数中使用average ='micro'。它的工作原理没有任何错误,但在准确性,准确性和召回率上却给出了相同的分数。
review,label
Colors & clarity is superb,positive
Sadly the picture is not nearly as clear or bright as my 40 inch Samsung,negative
Run Code Online (Sandbox Code Playgroud)
review,label
The picture is clear and beautiful,positive
Picture is not clear,negative
Run Code Online (Sandbox Code Playgroud)
from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import BernoulliNB
from sklearn.metrics import confusion_matrix
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import …Run Code Online (Sandbox Code Playgroud)