In [24]:
x_axis = np.linspace(1, 6)
yy_lr = -(w1_final/w2_final)*x_axis - b_final/w2_final

plt.figure(figsize =(10,7))
plt.scatter(X_test[:,0], X_test[:,1], c=y_test[:, 0], cmap=cm.coolwarm)
plt.plot(x_axis, yy_lr, label = 'Logistic Regression Line', c='r')
plt.title('Test Dataset')
plt.xlabel('feature 1')
plt.ylabel('feature 2')
plt.legend()
Out[24]:
<matplotlib.legend.Legend at 0x7fb5a47c6240>