I am trying to get Highest frequency terms out of vectors in scikit-learn.
From example It can be done using this for each Categories but i want it for each files inside categories.
if opts.print_top10:
print "top 10 keywords per class:"
for i, category in enumerate(categories):
top10 = np.argsort(clf.coef_[i])[-10:]
print trim("%s: %s" % (
category, " ".join(feature_names[top10])))
I want to do this for each files from testing dataset instead of each categories.
Where should i be looking?
Thanks
EDIT: s/discrimitive/highest frequency/g (Sorry for the confusions)
You can use the result of transform together with
get_feature_namesto obtain the term counts for a given document.