Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

How can educating employees help stop cyber-crime?

Answered: 1 week ago

Question

The Nature of Nonverbal Communication

Answered: 1 week ago

Question

Functions of Nonverbal Communication

Answered: 1 week ago

Question

Nonverbal Communication Codes

Answered: 1 week ago