Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

A First Course In Discrete Mathematics

Authors: John C Molluzzo, Fred Buckley

1st Edition

1478634383, 9781478634386

More Books

Students also viewed these Mathematics questions

Question

List the general rights of common stockholders.

Answered: 1 week ago