Question: R Question a set . seed(666) library(ISLR) index=sample(1: nrow(OJ) , 800, replace=F) OJtrain=0][index, ] OJtest=0] [-index, ] b ) {r} library(tree) OJtraintree=tree( Purchase~. , data=0]train)

R Question

R Question a set . seed(666) library(ISLR)R Question a set . seed(666) library(ISLR)
a set . seed(666) library(ISLR) index=sample(1: nrow(OJ) , 800, replace=F) OJtrain=0][index, ] OJtest=0] [-index, ] b ) "{r} library(tree) OJtraintree=tree( Purchase~. , data=0]train) summary (OJtraintree) Classification tree: tree(formula = Purchase ~ ., data = 0]train) Variables actually used in tree construction: [1] "LoyalCH" "SalePriceMM" "PriceDiff" "ListPriceDiff" Number of terminal nodes: 8 Residual mean deviance: 0.7507 = 594.5 / 792 Misclassification error rate: 0. 1538 = 123 / 8002. ISLR, chapter 8, problem 4. I Sketch the tree (part a), and the partition of the predictor space (part b), by hand. (16 points, 5 for part a, 5 for part b) You can draw your tree by hand on paper, take a picture and embed it in your Rmd with the image tag

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 Mathematics Questions!