我将skealearn应用到10类文本分类中,我使用
def featureextraction2(data , clf):
data.dropna(inplace=True)
X_train, X_test, y_train, y_test = \
train_test_split(data['text'], data['class'], random_state = 0)
vect = CountVectorizer().fit(X_train)
X_train_vectorized = vect.transform(X_train)
#clf = LogisticRegression()
clf.fit(X_train_vectorized, y_train)
我想在tfidf中应用keras 当我使用此代码(在define model之后)不起作用
model.fit([X_train_vectorized], batch_size=64, y=to_categorical(y_train), verbose=1, validation_split=0.3,
shuffle=True, epochs=5, callbacks=[checkpointer])