Skip to content

Instantly share code, notes, and snippets.

@terrah27
Created February 3, 2019 21:05
Show Gist options
  • Save terrah27/8608fe865457eec519f75f4a7ea169b6 to your computer and use it in GitHub Desktop.
Save terrah27/8608fe865457eec519f75f4a7ea169b6 to your computer and use it in GitHub Desktop.
from sklearn.ensemble import RandomForestClassifier
# train model
rfc = RandomForestClassifier(n_estimators=10).fit(X_train, y_train)
# predict on test set
rfc_pred = rfc.predict(X_test)
accuracy_score(y_test, rfc_pred)
0.9995
f1_score(y_test, rfc_pred)
0.8666
recall_score(y_test, rfc_pred)
0.7878
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment