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

Function get_simple_data

unsupervised_class/kmeans.py:92–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

90
91
92def get_simple_data():
93 # assume 3 means
94 D = 2 # so we can visualize it more easily
95 s = 4 # separation so we can control how far apart the means are
96 mu1 = np.array([0, 0])
97 mu2 = np.array([s, s])
98 mu3 = np.array([0, s])
99
100 N = 900 # number of samples
101 X = np.zeros((N, D))
102 X[:300, :] = np.random.randn(300, D) + mu1
103 X[300:600, :] = np.random.randn(300, D) + mu2
104 X[600:, :] = np.random.randn(300, D) + mu3
105 return X
106
107
108def main():

Callers 3

mainFunction · 0.90
neural_kmeans.pyFile · 0.90
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected