Implementing RandomizedSearchCV
You are hoping that using a random search algorithm will help you improve predictions for a class assignment. You professor has challenged your class to predict the overall final exam average score.
In preparation for completing a random search, you have created:
param_dist
: the hyperparameter distributionsrfr
: a random forest regression modelscorer
: a scoring method to use
Este ejercicio forma parte del curso
Model Validation in Python
Instrucciones del ejercicio
- Load the method for conducting a random search in
sklearn
. - Complete a random search by filling in the parameters:
estimator
,param_distributions
, andscoring
. - Use 5-fold cross validation for this random search.
Ejercicio interactivo práctico
Prueba este ejercicio completando el código de muestra.
# Import the method for random search
from sklearn.model_selection import ____
# Build a random search using param_dist, rfr, and scorer
random_search =\
____(
estimator=___,
param_distributions=____,
n_iter=10,
cv=____,
scoring=____)