from sklearn.model_selection import GridSearchCV,
params = {"max_depth": range(1, 11), "max_features": range(4, 19)}
grid = GridSearchCV(tree, params, cv=5, n_jobs=-1, verbose=True)
grid.fit(X_train, y_train)
grid.best_params_, grid.best_score_ , grid.best_estimator_
grid.param_grid[param_name], grid.cv_results_
модель обучается на сетке параметров