Complete the code to import the RandomizedSearchCV class from scikit-learn.
from sklearn.model_selection import [1]
The RandomizedSearchCV class is imported from sklearn.model_selection to perform randomized hyperparameter search.
Complete the code to create a RandomizedSearchCV object with a model and parameter distribution.
search = RandomizedSearchCV(estimator=[1], param_distributions=param_dist, n_iter=10, cv=5)
The estimator argument expects the model object to tune, such as a classifier or regressor.
Fix the error in the code to fit the RandomizedSearchCV object on training data.
search.[1](X_train, y_train)The fit method trains the RandomizedSearchCV object on the training data to find the best parameters.
Fill both blanks to access the best parameters and best score after fitting.
best_params = search.[1] best_score = search.[2]
After fitting, best_params_ gives the best found parameters, and best_score_ gives the best cross-validation score.
Fill all three blanks to create a parameter distribution dictionary for RandomizedSearchCV.
param_dist = {
'n_estimators': [1],
'max_depth': [2],
'criterion': [3]
}The parameter distribution dictionary uses ranges or lists of possible values for each hyperparameter to explore during randomized search.
