MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / get_xor

Function get_xor

svm_class/util.py:75–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73
74
75def get_xor():
76 X = np.zeros((200, 2))
77 X[:50] = np.random.random((50, 2)) / 2 + 0.5 # (0.5-1, 0.5-1)
78 X[50:100] = np.random.random((50, 2)) / 2 # (0-0.5, 0-0.5)
79 X[100:150] = np.random.random((50, 2)) / 2 + np.array([[0, 0.5]]) # (0-0.5, 0.5-1)
80 X[150:] = np.random.random((50, 2)) / 2 + np.array([[0.5, 0]]) # (0.5-1, 0-0.5)
81 Y = np.array([0]*100 + [1]*100)
82 return X, Y
83
84
85def get_donut():

Callers 2

xorFunction · 0.90
xorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected