Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started