Skip to content
Advertisement

Random Forest tuning with RandomizedSearchCV

I have a few questions concerning Randomized grid search in a Random Forest Regression Model. My parameter grid looks like this:

JavaScript

and my code for the RandomizedSearchCV like this:

JavaScript

is there any way to calculate the Root mean square at each parameter set? This would be more interesting to me as the R^2 score? If I now want to get the best parameter set, as printed underneath i would also use the lowest RMSE score. Is there any way to do that?

JavaScript

thank you, R

Advertisement

Answer

Add the ‘scoring’-parameter to RandomizedSearchCV.

JavaScript

Alternative options can be found in the docs

With this, you can print the RMSE for each parameter set, along with the parameter set:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement