September 2019
Intermediate to advanced
420 pages
10h 29m
English
In the following steps, you will be evaluating the trained perceptron on the test data:
In [10]: from sklearn.metrics import accuracy_score... accuracy_score(p.predict(X), y)Out[10]: 1.0
Perfect score!
In [10]: def plot_decision_boundary(classifier, X_test, y_test):... # create a mesh to plot in... h = 0.02 # step size in mesh... x_min, x_max = X_test[:, 0].min() - 1, X_test[:, 0].max() + 1... y_min, y_max = X_test[:, 1].min() - 1, X_test[:, 1].max() + 1... xx, yy = np.meshgrid(np.arange(x_min, ...
Read now
Unlock full access