July 2017
Intermediate to advanced
382 pages
9h 13m
English
Since the perceptron is a linear classifier, you can imagine that it would have trouble trying to classify data that is not linearly separable. We can test this by increasing the spread (cluster_std) of the two blobs in our toy dataset so that the two blobs start overlapping:
In [12]: X, y = make_blobs(n_samples=100, centers=2,... cluster_std=5.2, random_state=42)... y = 2 * y - 1
We can plot the dataset again using Matplotlib's scatter function:
In [13]: plt.scatter(X[:, 0], X[:, 1], s=100, c=y);... plt.xlabel('x1')... plt.ylabel('x2')
As is evident in the following figure, this data is no longer linearly separable because there is no straight line that perfectly separates ...
Read now
Unlock full access