Question

Create a dataset as in the previous examples using the Gaussian blobs and split it into training and testing sets. Create an instance of the perceptron class (e.g., p = Perceptron ()), then use its train function p.train to train the weights and the bias. You can use a learning rate n = 0.05 and 500 iterations.

Now use the predict function p.predict to obtain the predictions for the training and the test data. Evaluate the train and test accuracies. Plot a scatter plot of the data set and the decision boundary.