Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. SVM. An SVM classifier is trained on 44 images, Xi with binary labels yi=1. Three of the images in the training data set are:
1. SVM. An SVM classifier is trained on 44 images, Xi with binary labels yi=1. Three of the images in the training data set are: X1=1111000000000000,X2=0000111100000000,X3=0000000011110000 with labels y1=1,y2=1,y3=1. You are given a test image, X=110.50000.5100000000 (a) The training and test images, Xi and X, are converted to 16 -dimensional vectors xi and x. Find the squared distances di=xxi2,i=1,2,3. (b) Suppose a kernel is K(x,xi)=max{0,1xix2}. What value of >0 guarantees that K(x,xi)>0 for yi=1 and K(x,xi)=0 for yi=1 for i=1,2,3. (c) Complete the following python function, def predict(Xtr, ytr, X,..): " " " Parameters Xtr: Training data, shape (ntr, nrow, ncol) ytr: Training labels, shape (ntr,) X: Test data, shape (n,nrow,ncol) ... Add other parameters as needed Returns : yhat: Predicted labels, shape (n, " " " ... return yhat to perform the SVM classification, z=i=1niyiK(x,xi)+b,y={1,1,ifz>0otherwise. For full credit, use python broadcasting
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