I have a news dataset and want to separate them between two classes. For this I thought of using Bag of words, but I'm not getting with Sklearn. I've tried the following:
#Bag of words
from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer()
print(vectorizer.fit_transform(traindata).todense())
print(vectorizer.vocabulary_)
Any indication of how to use Bag of words using Pandas, Sklearn etc?