...

/

Perceptron Trick2

Perceptron Trick2

The perceptron trick helps us to find the best possible line that separates the two classes.

The boundary is not always accurate when model output is calculated the very first time. Let’s see how can we make the best possible fit function that separates the two classes.

The best possible fit function

We want the perfect the boundary that separates the two classes.

The following illustration will help you visualize this:

Quiz

Q

What did you observe in the illustration above? Are we moving the point closer to the line or the line closer to the misclassified point?

A)

line closer to the misclassified point

B)

misclassified point closer to the line

How to find the best possible fit?

In order to find the best possible boundary, the perceptron algorithm predicts the output, compares it with the actual output and learns the optimal weights for drawing the best possible fit function that separates the two classes.

Predict  the output

Recall the perceptron equation for making a boundary line:

w1x1+w2x2+b=0w_1x_1 + w_2x_2 + b = 0

The prediction is given by:

yy' = { 1 if w1x1+w2x2+...wnxn+bw_1x_1 + w_2x_2 +... w_nx_n + b ...

svg viewer

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy