Question: Use R programming [60 points] The file Social_Network_Ads.csv is a dataset about how effective the ads on social media are. The data has three variables
Use R programming
[60 points]
The file Social_Network_Ads.csv is a dataset about how effective the ads on social media are. The data has three variables (Gender, Age, and Estimated Salary) and one response variable (Purchased). This response variable has two value 0 (no purchased) and 1 (purchased successfully) (Lets consider 0 and 1 as factor, not number).
A)Split the data into training (75% of the data) and testing set (25% of data left)
B)Build a decision tree model for the training set. Predict the response value for the testing set. Report your confusion matrix for the prediction and plot the decision tree.
C)Build a random forest model for the training set. Predict the response value for the testing set. Report your confusion matrix for the prediction. Compare the result with part b? Is there any difference? Explain?
Data sources:
http://archive.ics.uci.edu/ml/datasets/Wine+Quality
https://www.superdatascience.com/
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
