Question: Question 4 Model hyperparameter tuning [ 2 5 marks ] ( a ) Write code to train a random forest classifier for the scikit -
Question Model hyperparameter tuning marks
a Write code to train a random forest classifier for the scikitlearns breast cancer dataset see the loadbreastcancer function Use the default hyperparameters of the classifier, apply fold crossvalidation, find and display the test score of the model.
b Write code to display the hyperparameters of the random forest classifier model.
c Write code to perform a randomized search to find the potentially best hyperparameters of applying the random forest model to the breast cancer dataset. Search in random samples of parameter settings. Use the search parameter settings below, and output the best model instance, score, and parameter values.
the number of trees: integer range from to in increments of
the number of features to consider when looking for the best split: integer range from to the number of features of the breast cancer data
the maximum depth of the tree: integer range from to
d Refer to the documentation of scikitlearn and answer the following questions.
i In the sklearn.modelselection module, beside GridSearchCV and RandomizedSearchCV, there are two other classes that search for optimized hyperparameters. What are the two classes?
ii Briefly describe the search strategy of the two classes.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
