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

Function get_data

unsupervised_class/kmeans_mnist.py:22–31  ·  view source on GitHub ↗
(limit=None)

Source from the content-addressed store, hash-verified

20from datetime import datetime
21
22def get_data(limit=None):
23 print("Reading in and transforming data...")
24 df = pd.read_csv('../large_files/train.csv')
25 data = df.values
26 np.random.shuffle(data)
27 X = data[:, 1:] / 255.0 # data is from 0..255
28 Y = data[:, 0]
29 if limit is not None:
30 X, Y = X[:limit], Y[:limit]
31 return X, Y
32
33
34# hard labels

Callers 2

mainFunction · 0.90
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected