Skip to content

Instantly share code, notes, and snippets.

@vijayanandrp
Created November 2, 2017 13:13
Show Gist options
  • Save vijayanandrp/2ec13037bee2432bcd0a13a13601b1a1 to your computer and use it in GitHub Desktop.
Save vijayanandrp/2ec13037bee2432bcd0a13a13601b1a1 to your computer and use it in GitHub Desktop.
Accuracy of SGDClassifier (support vector machine - SVM) - 91.27829560585884
Accuracy (after tuning) of SGDClassifier (support vector machine - SVM) - 93.40878828229027
Grid Search best score -
0.974302171023
Grid Search best parameters -
{'clf__alpha': 0.0001,
'tfidf__smooth_idf': False,
'tfidf__sublinear_tf': True,
'tfidf__use_idf': True,
'vect__ngram_range': (1, 1)}
Metrics classification report
precision recall f1-score support
alt.atheism 0.95 0.81 0.87 319
comp.graphics 0.88 0.97 0.92 389
sci.med 0.94 0.90 0.92 396
soc.religion.christian 0.90 0.95 0.93 398
avg / total 0.92 0.91 0.91 1502
Metric Confusion matrix
[[258 11 15 35]
[ 4 379 3 3]
[ 5 33 355 3]
[ 5 10 4 379]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment