Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use R Programming Question 2: We will use SVM in this problem, showing how it often gets used even when the data are not suitable,

Use R Programming

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 with AI-Powered 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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

Students also viewed these Mathematics questions

Question

=+c) Should Shawn purchase the long-range predictions?

Answered: 1 week ago