Intro to Statistical Learning (2nd Ed), Solution to Problem 9.7a
9.7A: In this problem, you will use support vector approaches in order to predict whether a given car gets high or low gas mileage based on the Auto data set. (a) Create a binary variable that takes on a 1 for cars with gas mileage above the median, and a 0 for cars with gas mileage below the median. (b) Fit a support vector classifier to the data with various values of cost, in order to predict whether a car gets high or low gas mileage. Report the cross-validation errors associated with different values of this parameter. Comment on your results. Note you will need to fit the classifier without the gas mileage variable to produce sensible results. (c) Now repeat (b), this time using SVMs with radial and polynomial basis kernels, with different values of gamma and degree and cost. Comment on your results. (d) Make some plots to back up your assertions in (b) and (c). Download Book: https://www.statlearning.com/ Authors' Lectures (R): https://youtube.com/playlist?list=PLoROMvodv4rOzrYsAxzQyHb8n_RWNuS1e&si=NP0wJ6RjP8XkxU7y Authors' Lectures (Python): https://youtube.com/playlist?list=PLoROMvodv4rPP6braWoRt5UCXYZ71GZIQ&si=0Z8tx4xlPLEyjZ70 https://colab.research.google.com/drive/1nC6mQqSwo8kjmvias_0JlQeVp2aZyKJD?usp=sharing
Download
0 formatsNo download links available.