Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Programming assignments: 1. Write a function called kernelClassify that will return the class +1 or -1 based on the input of a single data point
Programming assignments: 1. Write a function called kernelClassify that will return the class +1 or -1 based on the input of a single data point to classify, a set of support vectors, their corresponding values and the b constant offset Specifically, the function will be called as: kernelClassify (dataPt, suppVecs, alphas,b) where dataPt is a numpy array with shape/size [1,6], suppVecs is a numpy array with shape/size [N,7] (the first 6 columns are features, the last column is +1 or-1 label), alphas is a numpy array with shape/size [N,1] with non-negative a values matching each vector in suppVecs, and b is a single number offset. The function will return a single number +1 or -1 to indicate whether the dataPt is in class +1 or -1 This function will use the kernel: K(x, v)- IxlIvl, where xl is the vector with the absolute lx1l values in x: lxl. This is NOT the magnitude of x Classification will be performed using: b +2a'y'K(ru), testing whether this value is above +1 or below -1 If the sum is between +1 and -1 (it is TOO CLOSE to the separator), we recommend you output 0 as your answer (but we will not take off points if you output 1 or -1 in this homework. Programming assignments: 1. Write a function called kernelClassify that will return the class +1 or -1 based on the input of a single data point to classify, a set of support vectors, their corresponding values and the b constant offset Specifically, the function will be called as: kernelClassify (dataPt, suppVecs, alphas,b) where dataPt is a numpy array with shape/size [1,6], suppVecs is a numpy array with shape/size [N,7] (the first 6 columns are features, the last column is +1 or-1 label), alphas is a numpy array with shape/size [N,1] with non-negative a values matching each vector in suppVecs, and b is a single number offset. The function will return a single number +1 or -1 to indicate whether the dataPt is in class +1 or -1 This function will use the kernel: K(x, v)- IxlIvl, where xl is the vector with the absolute lx1l values in x: lxl. This is NOT the magnitude of x Classification will be performed using: b +2a'y'K(ru), testing whether this value is above +1 or below -1 If the sum is between +1 and -1 (it is TOO CLOSE to the separator), we recommend you output 0 as your answer (but we will not take off points if you output 1 or -1 in this
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