Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@alinazhanguwo
Created April 24, 2019 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alinazhanguwo/038c6b636e36ba2eec6d61546d1d7586 to your computer and use it in GitHub Desktop.
Save alinazhanguwo/038c6b636e36ba2eec6d61546d1d7586 to your computer and use it in GitHub Desktop.
%%time
svc = LinearSVC(dual=False)
svc.fit(X_train_tfidf, y_train)
scores = cross_val_score(svc, X_test_tfidf, y_test, scoring='accuracy', n_jobs=-1, cv=3)
print('Cross-validation mean accuracy {0:.2f}%, std {1:.2f}.'.format(np.mean(scores) * 100, np.std(scores) * 100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment