def plot_decision_boundary(pred_func):
    (x_min, x_max) = ((X[:, 0].min() - 0.5), (X[:, 0].max() + 0.5))
    (y_min, y_max) = ((X[:, 1].min() - 0.5), (X[:, 1].max() + 0.5))
    h = 0.01
    (xx, yy) = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h))
    Z = pred_func(np.c_[(xx.ravel(), yy.ravel())])
    Z = Z.reshape(xx.shape)
    plt.contourf(xx, yy, Z, cmap=plt.cm.Spectral)
    plt.scatter(X[:, 0], X[:, 1], c=y, cmap=plt.cm.Spectral)
def plot_decision_boundary(pred_func):
    (x_min, x_max) = ((X[:, 0].min() - 0.5), (X[:, 0].max() + 0.5))
    (y_min, y_max) = ((X[:, 1].min() - 0.5), (X[:, 1].max() + 0.5))
    h = 0.01
    (xx, yy) = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h))
    Z = pred_func(np.c_[(xx.ravel(), yy.ravel())])
    Z = Z.reshape(xx.shape)
    plt.contourf(xx, yy, Z, cmap=plt.cm.Spectral)
    plt.scatter(X[:, 0], X[:, 1], c=y, cmap=plt.cm.Spectral)