Is nested cross validation same as using randomizedsearchCV?
You can use RandomizedSearchCV
during nested cross validation. Just be aware that in every iteration of the outer loop of the cross-validation, a different set of hyperparameters will be evaluated, meaning that the generalization performance (the score computed in the outer loop) does not correspond to a given set of parameters, but rather a set of optimized models.
This is similar to what we will later do in the Regularization of linear regression model notebook in Module 4 where a set of equally valid alphas
are found for RidgeCV
.
Also take into account that the computational cost increases with the number of iterations of the RandomizedSearchCV
(which should itself be increased when adding hyperparameters), so cross-validating those results will increase the required computing resources as many times as folds you evaluate.
Thank you