From the course: Python: Working with Predictive Analytics

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Hyperparameter optimization

Solution: Hyperparameter optimization - Python Tutorial

From the course: Python: Working with Predictive Analytics

Start my 1-month free trial

Solution: Hyperparameter optimization

(funky music) - [Instructor] Here is how I solved the hyperparameter optimization challenge. First, let's open the solution begin file and scroll down. First, let's look at decision tree. We will start by uncommenting the parameter grid section So for that, I'm selecting four lines, starting from 328, right-click, and select Uncomment. We will create the parameter grid for decision tree. So let's start replacing the asterisks with the values. Minimum samples leaf is the minimum number of samples required to be at the leaf node. So I will add values between nine through 13 with step size of one. So let's start doing that. It will be equal to np.arrange. Nine through 13 with the step size of one. And integer means it's an integer. If integer was not given, it would infer the data type from the other input arguments. I could've also typed it as "9, 10, 11, 12" but suppose we are giving it a larger range in the future that we don't want to type each and every element. So we can use this…

Contents