我正在使用sklearn进行文本分类,我有以下管道:
from sklearn.pipeline import Pipeline
from sklearn.naive_bayes import MultinomialNB
text_clf = Pipeline([
('vect', CountVectorizer()),
('clf', MultinomialNB())])
text_clf.fit(X_train, y_train)
然后出现此错误:
Anaconda3\lib\site-packages\sklearn\naive_bayes.py:465: RuntimeWarning: divide by zero encountered in log
self.class_log_prior_ = (np.log(self.class_count_) -