I have a multinomial Naive Bayes document classifier. I'm interested in knowing the contribution made by each word to a single classification.
That is, I'd like to be able to measure which words in a document are contributing most to the classification.
Is this just:
$ P( Class\ |\ word) \ =\ \frac{P( word\ |\ Class) \ P( Class)}{P( word)} $
...?
And then perhaps normalize to 0.0 - 1.0 between the words in the document. Or are there other approaches that are used to understand a classification with this model?
To give an example, if I'm classifying documents into "Mentions People" (True) or not (False), then for the document "Bob did a thing" I'd perhaps see:
- "Bob" = 0.8
- "did" = 0.1
- "a" = 0.01
- "thing" = 0.09
...signifying the model was mainly using "Bob" to classify the document.