Wondering how the sketch would look like for the question below. **QUESTION FROM CHAPTER...
50.1K
Verified Solution
Question
Accounting
Wondering how the sketch would look like for the question below.
**QUESTION FROM CHAPTER 8 -QUESTION 9 OF 'An Introduction to Statistical Learning with Applications in R**
2) Sketch the tree (part a), and the partition of the predictor space (part b), by hand.
PART A
```{r} set.seed(1) library(ISLR) train=sample(1:nrow(OJ),800,replace=F) OJtrain=OJ[train,] OJtest=OJ[-train,]
```
PART B
```{r} library(tree) tree.oj=tree(Purchase ~ ., data = OJtrain) summary(tree.oj) ```
PART B OUTCOME
Classification tree: tree(formula = Purchase ~ ., data = OJtrain) Variables actually used in tree construction: [1] "LoyalCH" "PriceDiff" "SpecialCH" "ListPriceDiff" "PctDiscMM" Number of terminal nodes: 9 Residual mean deviance: 0.7432 = 587.8 / 791 Misclassification error rate: 0.1588 = 127 / 800
Get Answers to Unlimited Questions
Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!
Membership Benefits:
- Unlimited Question Access with detailed Answers
- Zin AI - 3 Million Words
- 10 Dall-E 3 Images
- 20 Plot Generations
- Conversation with Dialogue Memory
- No Ads, Ever!
- Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Other questions asked by students
StudyZin's Question Purchase
1 Answer
$0.99
(Save $1 )
One time Pay
- No Ads
- Answer to 1 Question
- Get free Zin AI - 50 Thousand Words per Month
Best
Unlimited
$4.99*
(Save $5 )
Billed Monthly
- No Ads
- Answers to Unlimited Questions
- Get free Zin AI - 3 Million Words per Month
*First month only
Free
$0
- Get this answer for free!
- Sign up now to unlock the answer instantly
You can see the logs in the Dashboard.