Answered step by step
Verified Expert Solution
Question
1 Approved Answer
** The Following implemented in R (R Studio) ** Set up the Auto data: Load the ISLR package and the Auto data Determine the median
** The Following implemented in R (R Studio) **
- Set up the Auto data:
- Load the ISLR package and the Auto data
- Determine the median value for mpg
- Use the median to create a new column in the data set named mpglevel, which is 1 if mpg>median and otherwise is 0. Make sure this variable is a factor. We will use mpglevel as the target (response) variable for the algorithms.
- Use the names() function to verify that your new column is in Auto
- create a 75-25 train/test split, using seed 1234 but do not include columns name or mpg in either train or test
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started