Created
April 18, 2018 06:40
-
-
Save orico/09d70c49ea2025048cdfb4c6bb3adcc5 to your computer and use it in GitHub Desktop.
data set functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trainset_size = 60000 # ie., testset_size = 10000 | |
def download(): | |
mnist = fetch_mldata(‘MNIST original’) | |
X = mnist.data.astype(‘float64’) | |
y = mnist.target | |
print (‘MNIST:’, X.shape, y.shape) | |
return (X, y) | |
def split(train_size): | |
X_train_full = X[:train_size] | |
y_train_full = y[:train_size] | |
X_test = X[train_size:] | |
y_test = y[train_size:] | |
return (X_train_full, y_train_full, X_test, y_test) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment