0
$\begingroup$

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.

$\endgroup$
1
  • $\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
    Commented Feb 9, 2017 at 22:44

1 Answer 1

0
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.