Question: Using RStudio Problem 1 ( 1 0 pts ) This problem will use the OJ dataset which is part of the ISLR 2 package. The

Using RStudio
Problem 1(10 pts)
This problem will use the OJ dataset which is part of the ISLR2 package. The data is tracking two kinds of orange juice purchases. Run the following commands to make this dataset available for use in RStudio.
> install.packages(ISLR2)
> library(ISLR2)
> install.packages(tree)
> library(tree)
> attach(OJ)
> View(OJ)
> set.seed(1)
a.(2 pts) Show the command to create a random sample of 800 observations and the command to fit a classifier tree with Purchase as the response variable using the sample as training data.
b.(3 pts) Show the summary for the tree created. What is the training error rate?
c.(3 pts) Plot the tree, showing the text for each branch.
d.(2 pts) Which predictor is the most important in the tree?
In this problem, continue to work with the OJ dataset to answer the questions below.
> set.seed(1)
a.(4 pts) Using the test data from problem 1, predict the response on the test data. Produce a confusion matrix using the table function for the prediction vs. the actual Purchase data. What is the test error rate?
b.(3 pts) Use the cv.tree() function for the test tree to determine the optimal tree size.
c.(3 pts) Create a plot with the tree size on the x-axis and the cross-validated deviance on the y-axis. Show the plot here.
Problem 3(10 pts)
This problem will continue from the trees made on training and test data from the above problems.
> set.seed(1)
a.(3 pts) Prune the tree made from training data in problem 1 using 8 nodes in the prune.misclass function. Show the summary.
b.(2 pts) Plot the pruned tree with text and paste it here.
c.(3 pts) Prune the tree made from test data in problem 2 using 2 nodes in the prune.misclass function. Show the summary.
d.(2 pts) Plot the pruned tree with text and paste it here
Problem 4(10 pts)
This problem will examine components and concepts related to neural networks.
a.(2 pts) What are the layers that make up a neural network?
b.(2 pts) What is the purpose of the input layer? What form can the inputs take?
c.(2 pts) What is the purpose of the output layer?
d.(2 pts) What is the purpose of the hidden layer?
e.(2 pts) Why is the hidden layer named so?
Problem 5(10 pts)
This problem will focus on deep learning and neural network concepts.
a.(3 pts) What is the purpose of a convolutional neural network? What does it do?
b.(3 pts) What is the purpose of a recurrent neural network? What does it do?
c.(4 pts) What are the four key ingredients for deep learning? Define each one.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!