Question: Please can you help solve this using R studio (a) use any datasets example to training and testing datasets and use the training dataset to
Please can you help solve this using R studio
(a) use any datasets example to training and testing datasets and use the training dataset to find out the optimal value of hyperparameter C for a linear kernel-based svm.
(b) Train a svm classifier by using the linear kernel and the corresponding optimal value of hyperparameter C, then make predictions on the testing dataset, report the classification accuracy.
(c) Use the training dataset to find out the optimal values of hyperparameters C and for an RBF kernel-based svm.
(d) Train a svm classifier by using the RBF kernel and the corresponding optimal values of hyperparameters C and , then make predictions on the testing dataset, report the classification accuracy.
(e) Train a logistic regression model. Then use the testing dataset to conduct an ROC curve analysis to compare the predictive performance of the trained logistic regression model and those two svm classifiers trained by using linear and RBF kernels respectively.
Hint: Define set.seed(1). Given a pre-defined hyperparameter space - C: [0.01, 0.1, 1, 10, 100], and : [0.01, 0.1, 1, 10, 100].
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
