diff --git a/src/fun_utils.py b/src/fun_utils.py index 37d579d..cfa9d90 100644 --- a/src/fun_utils.py +++ b/src/fun_utils.py @@ -32,3 +32,17 @@ def split_data(x, y, tr_fraction=0.5): """ pass + +def load_mnist(csv_filename): + """Load the MNIST dataset. + input: + csv_filename: string with the path to the dataset to load + output: + X: set of images (numpy array) + y: labels (numpy array) + """ + data = read_csv(csv_filename) + z = np.array(data) + y = z[:, 0] + X = z[:, 1:] + return X, y