Hi mentor,
I’ve got a question regarding the max_depth from the Random Forest model, in the lab it says best value for max_depth=16, I don’t understand why it’s 16 not 4? Isn’t 16 increase overfitting of the train set?
Thanks
Christina
Hi mentor,
I’ve got a question regarding the max_depth from the Random Forest model, in the lab it says best value for max_depth=16, I don’t understand why it’s 16 not 4? Isn’t 16 increase overfitting of the train set?
Thanks
Christina
Very good point, Christina @Christina_Fan.
Your choice (max_depth=4
) is actually quite like how usually people might use the so-called “elbow method” to pick a hyperparameter by looking at a performance graph like the one in your screenshot.
It is only that the lab’s decision was made by picking a choice that maximizes the validation score. With 16
, if we had lost more (due to overfitting) than to gain, we would have seen 16
to score lower than 4
in the validation score, but that is not the case.
However, I agree that 16
is not a huge improvement over 4
. If my model was to serve a real world problem, and if I knew that my dev set might not be a good representation of the real-world data, then I would worry about my choice (and retain the possibility of finally using 4
).
Therefore, I suggest you to keep both approaches in your toolbox
and use them flexibly in practice.
Cheers,
Raymond
PS: Wikipedia’s page for Elbow method if you are interested, or, as I always suggest, google “elbow method” for materials of your learning style.
Thank you so much Raymond. That makes sense, I can see both train and test sets are doing better when max_depth=16 (or 64) but without overly complicated the tree I suppose.
Yes, but among the two sets, it is more important that the validation set (which corresponds to the validation score) does better. For a refresh of the relevant material, check out Course 2 Week 3 Lesson 1.
Cheers!