How to get most informative features for scikit-learn classifier for different class?
In the case of binary classification, it seems like the coefficient array has been flatten. Let’s try to relabel our data with only two labels: import codecs, re, time from itertools import chain import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.naive_bayes import MultinomialNB trainfile=”train.txt” # Vectorizing data. train = [] word_vectorizer = CountVectorizer(analyzer=”word”) … Read more