load_mnist: Load the mnist dataset into the workspace

Description Usage Arguments Details Value Examples

View source: R/downloadAndLoad.R

Description

load_mnist Loads the mnist dataset as the lists trainSet and testSet into the current workspace.

Usage

1
load_mnist(where = "./")

Arguments

where

Path to the folder containing the mnist directory. Default assumes that the current working directory contains the mnist folder.

Details

Assuming that you have downloaded the dataset with the download_mnist function, the load_mnist function loads the data into the lists trainSet and testSet. Both lists have three elements named n, x and y. n is the number of samples, x is the 28 by 28 images in rows and y is the label of the images. This function is inspired by the gist: brendan o'connor - gist.github.com/39760 - anyall.org

Value

Returns TRUE if successful.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
download_mnist('somePathToStore/')
load_mnist('samePathAsAbove/')
# Check the number of elements in training set
trainSet$n
# Plot a random digit
(ggDigit(trainSet$x[sample(1:trainSet$n,1),]))

## End(Not run)

gumeo/mnistr documentation built on May 17, 2019, 9:27 a.m.