Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started