Get startedGet started for free

Iteratively tune multiple hyperparameters

In this exercise, you will build on the function you previously created to take in 2 hyperparameters, build a model and return the results. You will now use that to loop through some values and then extend this function and loop with another hyperparameter.

The function gbm_grid_search(learn_rate, max_depth) is available in this exercise.

If you need to remind yourself of the function you can run the function print_func() that has been created for you

This exercise is part of the course

Hyperparameter Tuning in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Create the relevant lists
results_list = ____
learn_rate_list = ____
max_depth_list = ____

# Create the for loop
for learn_rate in ____:
    for max_depth in ____:
        ____.append(gbm_grid_search(____,____))

# Print the results
print(____)   
Edit and Run Code