Question: ** 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
