Skip to content

Instantly share code, notes, and snippets.

@dakshtrehan
Last active July 12, 2022 23:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dakshtrehan/4bc78644e2a376c1360d8371add41682 to your computer and use it in GitHub Desktop.
Save dakshtrehan/4bc78644e2a376c1360d8371add41682 to your computer and use it in GitHub Desktop.
from sklearn.ensemble import RandomForestClassifier
rf = RandomForestClassifier(n_estimator = 10, criterion = "entropy", max_depth = "5")
rf.fit(X_Train, Y_Train)
rf.score(X_Train, Y_Train)
rf.score(X_Train, Y_Train)
y_pred = rf.predict(X_Test)
#n_estimator = number of trees used in Random Forest(hyperparameter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment