Skip to content

Instantly share code, notes, and snippets.

@JustinSDK
Last active July 14, 2021 01:22
Show Gist options
  • Save JustinSDK/1935b6beddcef0b8ca0af2ddd73e2363 to your computer and use it in GitHub Desktop.
Save JustinSDK/1935b6beddcef0b8ca0af2ddd73e2363 to your computer and use it in GitHub Desktop.
二維線性不可分
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