Last active
July 14, 2021 01:22
-
-
Save JustinSDK/1935b6beddcef0b8ca0af2ddd73e2363 to your computer and use it in GitHub Desktop.
二維線性不可分
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
# https://openhome.cc/Gossip/DCHardWay/ab.csv | |
data = np.loadtxt('ab.csv', delimiter=',') | |
a = data[:,0] | |
b = data[:,1] | |
label = data[:,2] | |
zero = label == 0 | |
one = label == 1 | |
plt.xlabel('a') | |
plt.ylabel('b') | |
plt.gca().set_aspect(1) | |
plt.scatter(a[zero], b[zero], marker = 'o') | |
plt.scatter(a[one], b[one], marker = 'x') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment