I am running logistic regression on iris dataset. I computed thetas and this is how I draw a decision boundary line.
x_values = ([min(X_train[:,0]), max(X_train[:,0])])
y_values = - (theta[0] + np.dot(theta[1], x_values)) / theta[2]
plt.scatter(X_train[:, 0], X_train[:, 1], c=y_train, cmap=plt.cm.Set1, edgecolor='k')
plt.plot(x_values, y_values )
I tried this, but the result is odd.
X= np.c_[ X_train, np.zeros(100) ]
theta = theta.reshape(3)
d=0
xx, yy = np.meshgrid(np.arange(np.min(X_reduced[:, 0]), np.max(X_reduced[:, 0])), np.arange(np.min(X_reduced[:, 1]), np.max(X_reduced[:, 1])))
z = (-theta[0] * xx - theta[1] * yy - d) * 1. / theta[2]
fig = plt.figure(1, figsize=(8, 6))
ax = Axes3D(fig, elev=-150, azim=110)
ax.scatter(X[:100, 0], X[:100, 1], X[:100, 2], c=y_train, cmap=plt.cm.Set1, edgecolor='k', s=40)
ax.plot_surface(xx, yy, z, alpha = 0.5)
plt.show()
I guess d in plane equation (ax+by+c*z = d) shouldn't be equal to 0. So I'm completely confused about this.

