from sklearn.model_selection import GridSearchCV # Find best model settings param_grid = {'n_estimators': [50, 100, 200]} grid_search = GridSearchCV(RandomForestRegressor(), param_grid, cv=5) grid_search.fit(X_train, y_train) print(f"Best params: {grid_search.best_params_}")