So when my CNN projet is runing succesfully when I use tokenizer to modify the X test and X train
X_train = X_train.ravel()
X_test = X_test.ravel()
#
#y_train = y_train.ravel().tolist()
#y_test =y_test.ravel().tolist()
tokenizer = text.Tokenizer(num_words=config.vocab_size)
tokenizer.fit_on_texts(X_train)
X_train = tokenizer.texts_to_matrix(X_train)
X_test = tokenizer.texts_to_matrix(X_test)
X_train = sequence.pad_sequences(X_train,maxlen=config.max_len)
X_test = sequence.pad_sequences(X_test,maxlen=config.max_len)
But when I try to use Tf-idf vetorizer , it isnt workin for some reason
X_train = X_train.ravel()
X_test = X_test.ravel()
#
#y_train = y_train.ravel().tolist()
#y_test =y_test.ravel().tolist()
X_train = tfidf.fit_transform(X_train)
X_test = tfidf.fit_transform(X_test)
X_train = sequence.pad_sequences(X_train,maxlen=config.max_len)
X_test = sequence.pad_sequences(X_test,maxlen=config.max_len)
is there a possible solution to this? im asing because the output website that uses the model for predction of the emails uses a Tf-idf vectorizer for analysis the input texts
New contributor
Suvroneel Nathak is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.