Question: Need help with coding in R (13. In this problem, we implement and compare support vector machines {SVMs} under various settings. We study a simulated

Need help with coding in R

Need help with coding in R (13. In this problem, we implement

(13. In this problem, we implement and compare support vector machines {SVMs} under various settings. We study a simulated dataset which contains a binary response variable (Y) and two continuous covariates (XI and X1} over 300 observations. The dataset has been divided into a training set of sample size 200 {SVM_train.csv) and a test set of size 100 {SVM_test.csv). Analyze this data through the following steps. {a} Draw a scatter plot of covariates {XI and X1} in training set. Color the observations by their class labels. Analyze the two classes based on the plot. For example, are they visually separable? Can they be perfectly separated? Do you think the decision boundary is linear? {b} Fit the training set by linear SVM. Select the optimal cost C by cross-validation. Use the classifier you obtained to classify the test set. Plot the classification results on both training set and test set. (c) Fit the training set by SVM with Gaussian kernel. Select the optimal cost (I and tuning parameter 1! with cross-validation. Use the classifier you obtained to classify the test set. Plot the classification results on both training set and test set. (d) Plot and compare the ROC curves of the classifiers you obtained in Step (b) and (c) for training set and test set, respectively. Analyze these two ROC curves

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 Mathematics Questions!