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) **

  1. Set up the Auto data:
    1. Load the ISLR package and the Auto data
    2. Determine the median value for mpg
    3. 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.
    4. Use the names() function to verify that your new column is in Auto
    5. 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 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 Databases Questions!