Skip to content

Instantly share code, notes, and snippets.

@gustavoschmoeller
Last active January 11, 2021 17:32
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 gustavoschmoeller/b8bd2c3d73ba59f20944f45232f99782 to your computer and use it in GitHub Desktop.
Save gustavoschmoeller/b8bd2c3d73ba59f20944f45232f99782 to your computer and use it in GitHub Desktop.
parameters = {'n_estimators': range(10,200,10), 'max_depth': range(10,100,5)}
rf = RandomForestRegressor()
gs_rf = GridSearchCV(rf, parameters)
gs_rf.fit(X_train, y_train)
gs_rf.best_estimator_
RandomForestRegressor(bootstrap=True, ccp_alpha=0.0, criterion='mse',
max_depth=70, max_features='auto', max_leaf_nodes=None,
max_samples=None, min_impurity_decrease=0.0,
min_impurity_split=None, min_samples_leaf=1,
min_samples_split=2, min_weight_fraction_leaf=0.0,
n_estimators=30, n_jobs=None, oob_score=False,
random_state=None, verbose=0, warm_start=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment