Question: Data Set is in R library Load the OJ data set, which is in the ISLR library. Set the random seed to 10, using set.seed(10,
Data Set is in R library Load theOJdata set, which is in theISLRlibrary.
Set the random seed to 10, using
set.seed(10, sample.kind = "Rounding")
Usennet()to build an artificial neural network with 1 hidden node, to modelPurchaseas a function ofLoyalCH,SalePriceMM, andPriceDiff.
Enter the R code below.
Question 1
In this example, the predicted response value is the probability of purchasing Minute Maid orange juice (not the probability of purchasing Citrus Hill juice). In a few sentences, explain why this makes sense based on the signs (+ or -) of the weights on the edges fromLoyalCHto the hidden node, and from the hidden node to the response.
Question 2
What is the predicted probability that the first person in the data set will purchase Minute Maid?
Question 3
Compute (z), the output of the hidden node, for the first person in the data set.
Question 4
If we use a probability threshold of .5 to classify predicted purchases, what is the classification error rate for this data set?
Question 5
Suppose we classify predicted purchases as "MM" if the probability of purchasing Minute Maid is > .9, as "CH" if the probability of purchasing Minute Maid is < .1, and NA otherwise. What is the classification error rate among purchases for which we make a (non-NA) prediction?
Question 6
Write the R code you used to answer the previous question.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
