Skip to content

Instantly share code, notes, and snippets.

@sagarhowal
Created December 6, 2017 10:57
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 sagarhowal/e9623d70c3f2a5208283a7b180688307 to your computer and use it in GitHub Desktop.
Save sagarhowal/e9623d70c3f2a5208283a7b180688307 to your computer and use it in GitHub Desktop.
Random Forests in Ensemble Learning
from sklearn.ensemble import RandomForestClassifier
rnd_clf = RandomForestClassifier(n_estimators=500, max_leaf_nodes=16, n_jobs=-1, random_state=42)
rnd_clf.fit(X_train, y_train)
y_pred_rf = rnd_clf.predict(X_test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment