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

Function get_data

supervised_class/util.py:12–21  ·  view source on GitHub ↗
(limit=None)

Source from the content-addressed store, hash-verified

10import pandas as pd
11
12def get_data(limit=None):
13 print("Reading in and transforming data...")
14 df = pd.read_csv('../large_files/train.csv')
15 data = df.values
16 np.random.shuffle(data)
17 X = data[:, 1:] / 255.0 # data is from 0..255
18 Y = data[:, 0]
19 if limit is not None:
20 X, Y = X[:limit], Y[:limit]
21 return X, Y
22
23def get_xor():
24 X = np.zeros((200, 2))

Callers 9

app_caller.pyFile · 0.90
dt.pyFile · 0.90
knn_vectorized.pyFile · 0.90
bayes.pyFile · 0.90
nb.pyFile · 0.90
app_trainer.pyFile · 0.90
knn.pyFile · 0.90
multinomialnb.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected