This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
gs.fit(x_train,y_train) | |
y_pred = gs.predict(x_test) | |
gs.best_params_ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment