Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The na ve Bayes method is an ensemble method, as we learned in Lecture 5 . Assume we have three classifiers, and their predicted results
The nave Bayes method is an ensemble method, as we learned in Lecture Assume we have three classifiers, and their predicted results are given in Table The confusion matrix of each classifier is given in Table Calculate the final decision using the Nave Bayes method: Table Sample x Result Classifier Class Classifier Class Classifier Class Table Programming Problems: Use decision tree and random forest to train models using the titanic.csv dataset included in this assignment. Step : Read titanic.csv and observe a few samples, noting that there are both categorical and numerical features. If some features are missing, fill them in using the average of the same feature of other samples. Take a random of samples for training and use the remaining for testing. Step : Fit a decision tree model using independent variables pclass sex age sibsp and dependent variable survived Plot the full tree. Make sure survived is a qualitative variable taking yes or no in your code. You may see a tree similar to this one, but the actual structure and size may vary: Step : Use the GridSearchCV function to find the best value for the parameter maxleafnodes to prune the tree. Plot the pruned tree, which will be smaller than the tree you obtained in Step b Classifier Class Class Class Class a Classifier Class Class Class Class c Classifier Class Class Class Class
The nave Bayes method is an ensemble method, as we learned in Lecture Assume we have three classifiers, and their predicted results are given in Table The confusion matrix of each classifier is given in Table Calculate the final decision using the Nave Bayes method: Table Sample x Result Classifier Class Classifier Class Classifier Class Table Programming Problems: Use decision tree and random forest to train models using the titanic.csv dataset included in this assignment. Step : Read titanic.csv and observe a few samples, noting that there are both categorical and numerical features. If some features are missing, fill them in using the average of the same feature of other samples. Take a random of samples for training and use the remaining for testing. Step : Fit a decision tree model using independent variables pclass sex age sibsp and dependent variable survived Plot the full tree. Make sure survived is a qualitative variable taking yes or no in your code. You may see a tree similar to this one, but the actual structure and size may vary: Step : Use the GridSearchCV function to find the best value for the parameter maxleafnodes to prune the tree. Plot the pruned tree, which will be smaller than the tree you obtained in Step b Classifier Class Class Class Class a Classifier Class Class Class Class c Classifier Class Class Class Class
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