Question: ( 3 0 points ) Below is the pseudo - code of perceptron algorithm for binary classification. Intuitively, this algorithm finds an optimal weight w

(30 points) Below is the pseudo-code of perceptron algorithm for binary classification.
Intuitively, this algorithm finds an optimal weight w that can map any input data x
(e.g., features of a plant) to the corresponding class label y (e.g., a flower or not). The
subscript t denotes the t-th data sample: xt in R
2
is the vector of feature values (real
numbers) and yt =\pm 1 is the class label for the t-th sample:
1. w = w0.
2. Do Iterate until convergence
3. For each sample (xt
, yt), t =1,2,
4. If ytw, xt<=0
5. w = w + ytxt
Here convergence means weight w does not change at all over one pass through the
entire training dataset in the loop starting in step 3. A note on notation: xt denotes
the t-th sample in the training data, which is found in the t-th row of the matrix X
(features of all the data samples). yt
is the t-th element of the vector y (labels of all the
data samples). This is the notation used in the textbook. The transpose of a vector
or matrix M is denoted MT with an upper case T., denotes the dot product.
(a) Implement three helper functions (Shown in Table.1) for the perceptron algorithm
(MyPerceptron.py) and test it on the data provided on the class web site. X in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!