Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Copy and run the codes in your RStudio and answer questions below. You may need to install package e1071. set.seed(1) x = matrix(rnorm(20*2), ncol =2)

Copy and run the codes in your RStudio and answer questions below. You may need to install package e1071.

set.seed(1) x = matrix(rnorm(20*2), ncol =2) y = c(rep(-1,10), rep(1,10) ) x[y==1,] = x[y==1,] + 1 dat=data.frame(x=x, y=as.factor(y)) library (e1071) svm1 = svm(y~., data=dat, kernel="linear", cost=10, scale=FALSE ) plot(svm1, dat) svm1$index

(a) How many support vectors are there? (b) Change the cost parameter to cost=1. How many support vectors now?

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

Economics

Authors: Roger A. Arnold

12th edition

978-1305758674, 1305758676, 978-1285738321

More Books

Students also viewed these Economics questions

Question

Annoyance about a statement that has been made by somebody

Answered: 1 week ago

Question

Self-confidence

Answered: 1 week ago