1. Learn
  2. /
  3. Courses
  4. /
  5. HR Analytics: Predicting Employee Churn in Python

Exercise

Implementing GridSearch

You can now use the sklearn GridSearchCV() function to find the best combination of all of the max_depth and min_samples_leaf values you generated in the previous exercise.

Instructions

100 XP
  • Import the GridSearchCV function
  • Apply a GridSearchCV() function to your model using the parameters dictionary you defined earlier. Save this as param_search.
  • Fit param_search to the training dataset.
  • Print the best parameters found using best_params_ attribute.