Is there a way I can "look inside" a model once it's trained? For example, if I train a spam filter with a multinomialNB
, is there a way I can extract which words are most likely to make an email classify as spam? I'd like to see how the models determine the outcome once fitted.
-
$\begingroup$ I have not worked with multinomialNB before, but I see that it has the coef_ property. Extracting the model coefficients is one way to 'look inside' the model. $\endgroup$ – Hobbes Feb 9 '17 at 22:44
For the particular case of the MultinomialNB you can look here.
However if want you want is to determine which features are the most important, the SelectFromModel for selecting the most important features for the model.