Skip to content

Instantly share code, notes, and snippets.

Created Nov 19, 2020
What would you like to do?
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import GridSearchCV
lr_grid = {'max_depth' : [4,8,16,32,64,128],
'criterion' : ['entropy','gini']}
clf = RandomForestClassifier(n_estimators=100, max_features='sqrt', random_state=42)
gs = GridSearchCV(estimator = clf, param_grid=lr_grid,cv = 5),y_train)
y_pred = gs.predict(x_test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment