Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please use R code, thanks you! The objective of the questions to follow is to perform a multi-class classification by utilizing one-vs-one classification technique. a.
Please use R code, thanks you!
The objective of the questions to follow is to perform a multi-class classification by utilizing one-vs-one classification technique. a. Consider the following simulated training data in the data frame dat consisting of 4 features 21, 12, 13, 14 and one response vector y. set.seed (123); p=4;n=120 x=matrix(rnorm(n*p),n,p) y=c(rep("A",n/3), rep("B",n/3), rep ("C",n/3)) x[y=="A"]=x (y=="A")-1; x[y=="C"]=x[y=="C"]+1 dat=data.frame (x=x, y=y) b. The response vector y of the data frame dat contains 3-labels, A, B, C. Obtain three subsets of the training data: (i) dat.sub1: containing all rows in dat that correspond to the class labels y = A or y= B. (ii) dat sub2: containing all rows in dat that correspond to the class labels y= A or y=C. (iii) dat.sub3: containing all rows in dat that correspond to the class labels y = B or y=C. c. Fit a separate linear support vector machine model to each of the three data sub sets in part (b). Talking: Kevin BlackStep 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