In [23]:
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_train[:,0], X_train[:,1], c=y_train[:, 0], cmap=cm.coolwarm)
plt.plot(x_axis, yy_lr, label = 'Logistic Regression Line', c='r')
plt.title('Train Dataset')
plt.xlabel('feature 1')
plt.ylabel('feature 2')
plt.legend()
Out[23]:
<matplotlib.legend.Legend at 0x7fb5c0699dd8>