from sklearn.naive_bayes import GaussianNB  dd = train_data

#dd = responcies_df[(responcies_df[‘rating_grade’]==5) | (responcies_df[‘rating_grade’]==1)]

X_train, X_test, y_train, y_test = train_test_split(dd[‘lemma’],dd[‘category’],test_size=0.2);



clf = Pipeline([
(‘vect’, CountVectorizer(max_features=21000,ngram_range=(1,1))), # биграммы max_features=4500,
(‘tfidf’, TfidfTransformer()), #(n_components=60, n_iter=12, random_state=42)
(‘clf’,GaussianNB()) #RandomForestClassifier(class_weight=‘balanced’)LogisticRegression()
])

clf.fit(X_train,y_train)

y_pred = clf.predict(X_test)


print(classification_report(y_test, y_pred)) TypeError: A sparse matrix was passed, but dense data is required. Use X.toarray() to convert to a dense numpy array.