Implementation of the Perceptron algorithm for finding the weights of a Linear Discriminant function.
-
Take input from “train.txt” file. Plot all sample points from both classes.
-
Consider the case of a second order polynomial discriminant function. Generate the high dimensional sample points y using the following formula:
$y = [x1^2 x2^2 x1 * x2 x1 x2 1]$ Also, normalize any one of the two classes.
-
Use Perceptron Algorithm (both one at a time and many at a time) for finding the weight-coefficients of the discriminant function (i.e., values of w) boundary for your linear classifier in task 2.
Here α is the learning rate and 0 < α ≤ 1.
-
Three initial weights have to be used (all one, all zero, randomly initialized with seed fixed). For all of these three cases vary the learning rate between 0.1 and 1 with step size 0.1. Create a table which should contain your learning rate, number of iterations, and number of updates for all of the three initial weights. You also have to create a bar chart visualizing your table data.