I am really confused about how to calculate precision and recall in supervised machine learning algorithm using NB classifier with more than two classes.
Say for example
- I have three classes $A$, $B$, & $C$
- I have $10000$ Documents out of which $2000$ goes to training sample set (class $A=500$, class $B=1000$, class $C=500$)
- Now on basis of above training sample set classify rest $8000$ documents using NB classifier
- After classifying, $1000$ documents goes to class $A$ and $6000$ documents goes to class $B$ and $1000$ documents goes to $C$
- Now how to calculate precision and recall for all individual classes?
I figured out precision and recall for two classes here it goes
Say suppose there are two classes $A$, $B$
Now when a test is executed for documents labeled as $A$ there are two possible classifications for each document: if the classification is $A$, add 1 to “true A” (TA), if the classification is $B$ add 1 to “false B” (FB). Similarly for $B$: if the classification is $A$, add 1 to “false A” (FA) and if classification is B add 1 to “true B” (TB).
I want the same above situation when there are more than two classes