Skip to content

Instantly share code, notes, and snippets.

@vijayanandrp
Created November 2, 2017 12:56
Show Gist options
  • Save vijayanandrp/57a68918336d393639774653ca4bbd16 to your computer and use it in GitHub Desktop.
Save vijayanandrp/57a68918336d393639774653ca4bbd16 to your computer and use it in GitHub Desktop.
Best result by using Grid Search
Accuracy of MultinomialNB (naive Bayes) - 83.48868175765645
Accuracy (after tuning) of MultinomialNB (naive Bayes) - 93.27563249001332
Grid Search best score -
0.979618963226
Grid Search best parameters -
{'clf__alpha': 0.001,
'clf__fit_prior': False,
'tfidf__smooth_idf': True,
'tfidf__sublinear_tf': True,
'tfidf__use_idf': False,
'vect__ngram_range': (1, 2)}
Metrics classification report
precision recall f1-score support
alt.atheism 0.97 0.60 0.74 319
comp.graphics 0.96 0.89 0.92 389
sci.med 0.97 0.81 0.88 396
soc.religion.christian 0.65 0.99 0.78 398
avg / total 0.88 0.83 0.84 1502
Metric Confusion matrix
[[192 2 6 119]
[ 2 347 4 36]
[ 2 11 322 61]
[ 2 2 1 393]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment