TextBlob icon indicating copy to clipboard operation
TextBlob copied to clipboard

Accuracy of Naive Bayes classifier

Open chandra589 opened this issue 8 years ago • 4 comments

Hi, Does anyone know how to get the accuracy, precision, recall and most informative features of Naive Bayes Classifier which is already trained using movie corpus data.

Thank you

chandra589 avatar May 16 '16 11:05 chandra589

http://textblob.readthedocs.io/en/dev/classifiers.html#evaluating-classifiers

IvRRimum avatar Jun 03 '16 16:06 IvRRimum

This is only for the accuracy. What about precision, recall, and f-score?

Thanks.

ikmalpani avatar Apr 09 '17 23:04 ikmalpani

Hi, any answer for this?

radityagumay avatar Apr 21 '17 14:04 radityagumay

if you have a set of (a) predictions and (b) ground truth, you can calculate precision, recall, etc. by hand or by sklearn.

for example:

from sklearn.metrics import precision_score
print precision_score(y_true, y_pred)  # automatically calculates precision

mynameisvinn avatar Sep 01 '17 12:09 mynameisvinn