Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Tathagatd96/835f2ba0e0d2cbea845c5d78f53f0a3d to your computer and use it in GitHub Desktop.
Save Tathagatd96/835f2ba0e0d2cbea845c5d78f53f0a3d to your computer and use it in GitHub Desktop.
#Performance on test set
twenty_test=fetch_20newsgroups(subset='test',categories=categories,shuffle=True,random_state=42)
doc_test=twenty_test.data
predicted=text_clf.predict(doc_test)
print "Classifier Accuracy:"
print(np.mean(predicted==twenty_test.target))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment