the grid search of hyperparameters with -fold cross validation is an iterative process wrappedoptimizedand standardized by gridsearchcv(function the training process takes time due to the same and results in quite few useful attributes to analyze the best_score_ attribute helps us get the best cross validation score our decision tree regressor could achieve we can view the hyperparameters for the model that generates the best score using best_params_ we can view the detailed information of each iteration of gridsearchcv(using the cv_results_ attribute the following snippet showcases some of these attributes in [ ]print(" -squared::{}format(grid_cv_dtr best_score_)print("best hyperparameters::\ {}format(grid_cv_dtr best_params_) -squared:: best hyperparameters:{'min_samples_split' 'max_depth' 'max_leaf_nodes' 'min_samples_leaf' 'criterion''mse'the results are decent and show dramatic improvement over our linear regression model let' first try to understand the learning/model fitting results across different settings of this model fitting to get to different models prepared during our grid searchwe use the cv_results_ attribute of our gridsearchcv object the cv_results_ attribute is numpy array that we can easily convert to pandas dataframe the dataframe is shown in figure - figure - dataframe showcasing tuning results with few attributes of grid search with cv it important to understand that grid search with cross validation was optimizing on finding the best set of hyperparameters that can help prepare generalizable decision tree regressor it may be possible that there are further optimizations possible we use seaborn to plot the impact of depth of the tree on the overall score along with number of leaf nodes the following snippet uses the same dataframe we prepared using cv_results_ attribute of gridsearchcv object discussed previously in [ ]fig,ax plt subplots(sn pointplot(data=df[['mean_test_score''param_max_leaf_nodes''param_max_depth']] ='mean_test_score', ='param_max_depth'hue='param_max_leaf_nodes',ax=axax set(title="affect of depth and leaf nodes on model performance"