Answered step by step
Verified Expert Solution
Question
...
1 Approved Answer
8. Use package caret and train_data to create a random forest clas and answer the questions below. Create a random forest using var gen_election as
8. Use package "caret" and train_data to create a random forest clas and answer the questions below. Create a random forest using var gen_election as the target (class) variable and all of the other varia as predictors (do not include variables such as ID that you think sh be excluded from the analysis.). 8.1. (4 points) Use 5 as the value for ntree and use 2 as the val for mtry. What is the accuracy of the model? 8.2. (8 points) Keep ntree as 5, but change mtry to 7. What is th accuracy of the model? Between 2 and 7, which value of mtry would you recommend? 8.3. (4 points) Now use the recommended value of mtry but cha ntree to 10. What is the accuracy of the model? 8.4. (8 points) Now use the recommended value of mtry but cha ntree to 50. What is the accuracy of the model? Between 10 an 50, which value of ntree would you recommend? 8.5. (10 points) Use your recommended ntree and mtry to build random forest classifier based on train_data. Now make predict over test data. Set threshold at 0.5. Create the confusion matr and paste it in the space below
![image text in transcribed](https://s3.amazonaws.com/si.experts.images/answers/2024/07/668ac5a02fc73_592668ac5a00a2b9.jpg)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
![blur-text-image](https://dsd5zvtm8ll6.cloudfront.net/includes/images/document_product_info/blur-text-image.webp)
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
![blur-text-image](https://dsd5zvtm8ll6.cloudfront.net/includes/images/document_product_info/blur-subtext-image.webp)
Step: 3
![blur-text-image](https://dsd5zvtm8ll6.cloudfront.net/includes/images/document_product_info/blur-subtext-image.webp)
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started