1

After I have trained my model, I can get the most important features for each class by doing something similar like, How to get most informative features for scikit-learn classifiers?

But I want for each given classification that I do, basically, for each model.predict() that I do, I want to know the most informative features which helped it in picking that prediction. How do I do this?

Community
  • 1
  • 1
n00b
  • 1,549
  • 2
  • 14
  • 33
  • Which model/classifier are you using? – Erol Mar 02 '16 at 08:14
  • @Erol SVM classifier – n00b Mar 02 '16 at 09:30
  • I think the most informative features for your classifier applies to every sample you classify. The features that have the most weight will determine the outcome for each sample. That is why you do not train your classifier with more than one sample, all of which determine your support vectors and feature weights. – Erol Mar 02 '16 at 13:22
  • [Possible duplicate?](http://stackoverflow.com/questions/30017491/problems-obtaining-most-informative-features-with-scikit-learn) It gives a pretty comprehensive explanation of feature importances in SVM. – jakevdp Mar 02 '16 at 19:12

0 Answers0