diff options
| author | manzerbredes <manzerbredes@mailbox.org> | 2021-02-21 10:07:19 +0100 |
|---|---|---|
| committer | manzerbredes <manzerbredes@mailbox.org> | 2021-02-21 10:07:19 +0100 |
| commit | a136feac0734c72ad39e681386e0df27cd133b64 (patch) | |
| tree | 89080b4de5ae33820efb7bacdf58b0739fb1fb38 /logistic_regression/binary.py | |
| parent | 14856930a79b4246bff951330e56200ba043d34d (diff) | |
Diffstat (limited to 'logistic_regression/binary.py')
| -rwxr-xr-x | logistic_regression/binary.py | 8 |
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() |
