Does anyone knows how sklearn.naive_bayes.MultinomialNB estimates the model ?


And how can i know the importance of each features (like the P-Value in a linear regression) ?

I'm running this example of text classification : http://scikit-learn.org/stable/tutorial/text_analytics/working_with_text_data.html

I would like to know on which word it classifies.


1 Answer 1


Your first question is quite broad. Are you asking for how a Multinomial Naive Bayes works or what the sklearn code does to perform its estimation? The documentation references this site which explains how it works.

As for the second question, feature importance, the value each feature's coefficient is one measure of its importance. You can find the coefficient value in clf.coef_. The larger the value, the more likely that feature is associated with the target class.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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