Open achang2 opened 3 years ago
Hello which page in the book are you referencing?
Sorry, I should have included that in my original post. I'm looking at Chapter 2, page 77
@achang2 It is just a matter of the output of scikit-learn. You can set the random_state parameter of the estimator to get same results each time. All other parameters except the ones you searched over are all intialized to the default value.
@Praful932 Thanks, that makes sense. But what about showing all the other hyperparemeters (like bootstrap, min_samples_leaf, etc.)? Why aren't those showing up when I run them locally.
@achang2 My best guess is because all other parameters are the default ones. Take a look at the documentation. Also like I said it's the matter of the output of scikit. You could take a look at the source and If I am not wrong, the magic methods are the ones which decide the printable output.
In both the book and the example on github, when using the grid search to find the best estimator, gridsearch.best_estimator returns something that looks like the following:
However, when I run the same thing on my local machine, all I get is this:![image](https://user-images.githubusercontent.com/11891298/92843866-d6165880-f3aa-11ea-8efc-b30cc053c7b6.png)
So two questions. The first is why am I getting slightly different hyperparameters (I've seen it flip-flop between 6 and 8 for max_features). Is it because the folds are randomized, so the models that are trained are slightly different? And the second question is why in the output it only gives me the two hyperparameters I asked it search over, but not the rest. Is there some setting I'm missing?