Question: Please use R Programming for this question. Question 2: We will use SVM in this problem, showing how it often gets used even when the

Please use R Programming for this question.

Please use R Programming for this question. Question 2: We will use

Question 2: We will use SVM in this problem, showing how it often gets used even when the data are not suitable, by first engineering the numerical features we need. There is a Star Wars dataset in the dplgr library. Load that library and you will be able to see it {headlstarwarsl}. a. There are some variables we will not use, so first remove films, vehicles, starshjpg and name. Also remove rows with missing values b. Several variables are categorical. We will use dummy variables to make it possible for SVM to use these. Show the resulting head of the dummy variables including the target column gender. c. Use SUM to predict gender and report the accuracy. First, create the dataset for 66% training and 34% testing and a seed of 94 for the random partitioning. d: Given that we have so many variables, it makes sense to consider using PCA. Run PCA on the data and determine an appropriate number of components to use from the graph. Create a reduced version of the data with that number of principle components by first finding and removing near zero variance predictors using the following code: nzv c nearZeroVar{numeric train] W W filtered

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!