Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the RandomizedSearchCV class from scikit-learn.
ML Python
from sklearn.model_selection import [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
2fill in blank
mediumComplete the code to create a RandomizedSearchCV object with a model and parameter distribution.
ML Python
search = RandomizedSearchCV(estimator=[1], param_distributions=param_dist, n_iter=10, cv=5)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
3fill in blank
hardFix the error in the code to fit the RandomizedSearchCV object on training data.
ML Python
search.[1](X_train, y_train) Drag options to blanks, or click blank then click option'
Attempts:
3 left
4fill in blank
hardFill both blanks to access the best parameters and best score after fitting.
ML Python
best_params = search.[1] best_score = search.[2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
5fill in blank
hardFill all three blanks to create a parameter distribution dictionary for RandomizedSearchCV.
ML Python
param_dist = {
'n_estimators': [1],
'max_depth': [2],
'criterion': [3]
} Drag options to blanks, or click blank then click option'
Attempts:
3 left