Question: import the iris data using: [WITH PYTHON] import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd from sklearn

import the iris data using: [WITH PYTHON]

import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd from sklearn import datasets

iris = datasets.load_iris()

Task:

import the iris data using: [WITH PYTHON] import numpy as np import

Problem 3: Perceptron learning algorithm (30 points) 1. Apply the Scikit-learn implementation of PLA (see sklearn.Linear model.Perceptron to optimally (linearly) separate first the "Iris setosa" (class 0) from the other two species. Report the numerical error rate (Perceptron.scorep. Visualize the separation plane in 2-dimenional PCA space. (15 points) For plotting the hyperplane, you may find this useful: 1 interNum 100 2 xx8= np.linspace(X[ : , ].min ( ), X[:,].max ( ), interNum) 4 xxn= np.iinspace (XL:,n].min ( ), X[:,n].max (), interNum) 6 gridData np.array (np.meshgrid(xx0, .. ., xxn)) .T.reshape (-1,n) 7 gridPrediction = . . . # prediction boundary set 9 gridDataBoundgridData[np.abs(gridPrediction) SOME DISTANCE, :] 10 gridDataBoundPCA .. . 2. With the same PCA space as above, keep using PLA to separate the other two species (class 1 & 2). Report the numerical error rate and visualize the separation plane in 2-dimensional PCA space. (15 points)

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!