Question: R Programming Question Generate a data set with n-1000 and p-2, such that the observations belong to two classes with a quadratic decision boundary between
R Programming Question

Generate a data set with n-1000 and p-2, such that the observations belong to two classes with a quadratic decision boundary between them. For instance, you can do this as follows: set.seed (1) x1-runif(1000)-0.5 x2-runif (1000)-0.5 y-1*(x1A2-x2A2>0) Create a training data set with 200 random samples. Plot the training observations, colored according to their class labels. Your plot should display X1 on the x-axis, and X2 on the y axis. a) b) Fit a support vector classifier (tuned) to the data with X1 and X2 as predictors. Obtain a class prediction for each test observation. Plot the training and test observations, colored according to the predicted class labels c) Fit a SVM (tuned) using a polynomial kernel to the data. Obtain a class prediction for each training and d) Fit a SVM (tuned) using a radial kernel to the data. Obtain a class prediction for each training and test e) Comment your results. test observation. Plot the train test observations, colored according to the predicted class labels. observation. Plot the train and test observations, colored according to the predicted class labels
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
