aboutsummaryrefslogtreecommitdiff
path: root/logistic_regression/binary.py
diff options
context:
space:
mode:
Diffstat (limited to 'logistic_regression/binary.py')
-rwxr-xr-xlogistic_regression/binary.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/logistic_regression/binary.py b/logistic_regression/binary.py
index 1c3f608..ab0dad4 100755
--- a/logistic_regression/binary.py
+++ b/logistic_regression/binary.py
@@ -97,8 +97,12 @@ scatter=plt.scatter(x_1,x_2,c=np.round(h(x_1,x_2)),marker="o")
handles, labels = scatter.legend_elements(prop="colors", alpha=0.6)
legend = ax.legend(handles, ["Class A","Class B"], loc="upper right", title="Legend")
-x=np.arange(0,10,0.2)
-plt.plot([1,2],[2,2])
+# Plot decision boundaries
+x=np.arange(0,10,0.01)
+y=-w1/w3 +(w2/-w3)*x
+plt.fill_between(x,y,np.min(y),alpha=0.2)
+plt.fill_between(x,y,np.max(y),alpha=0.2)
+plt.plot(x,y,"--")
# Save
plt.tight_layout()