Skip to content

Instantly share code, notes, and snippets.

@alinazhanguwo
Created April 24, 2019 20:01
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/5d1db43ee9988d4ca40b9fb288620c47 to your computer and use it in GitHub Desktop.
Save alinazhanguwo/5d1db43ee9988d4ca40b9fb288620c47 to your computer and use it in GitHub Desktop.
logreg = LogisticRegression()
%%time
logreg.fit(X_train_tfidf, y_train)
# Return accuracy
scores = cross_val_score(logreg, X_train_tfidf, y_train, 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