Plotting train / val rmse for multiple values of a feature in random forests

in assignment 2, on executing the sample code, I get this plot It is not as per the assertion mentioned: it appears that the best value for max_depth is around 20, beyond which the model starts to overfit. Am I doing something wrong? I don’t think I had to provide any inputs from my side in this block of code for test_params and test_params_and_plot . There seems to be no convergence Please let me know if there is something to be done in this, as per analysis regarding max_depth

Hey, you can see the lowest peak of the red line(Validation RMSE) is near the point 20. So yes, the best value for max_depth is around 20. Also it’s not always necessary for the training RMSE and val_RMSE to converge at some point.


Hi, I get the same plot. The point at which the test error turns around is very slight on the graph, but you can just about make out a turning point after max_depth = 20. But yeah, you’re right, it’s hard to see.

1 Like