download_qmnist: Download QMNIST

View source: R/qmnist.R

download_qmnistR Documentation

Download QMNIST

Description

Download QMNIST database of handwritten digits. This is the same as the MNIST digits, but with an extended test dataset of 60,000 digits.

Usage

download_qmnist(base_url = qmnist_url, verbose = FALSE)

Arguments

base_url

Base URL that the QMNIST files are located at.

verbose

If TRUE, then download progress will be logged as a message.

Format

A data frame with 785 variables:

px1, px2, px3 ... px784

Integer pixel value, from 0 (white) to 255 (black).

Label

The digit represented by the image, in the range 0-9.

Pixels are organized row-wise. The Label variable is stored as a factor.

There are 120,000 digits in the data set. The first 60,000 are the training set, as found in the qmnist-train-images-idx3-ubyte.hz file. The remaining 60,000 are the test set, from the qmnist-test-images-idx3-ubyte.gz file.

Items in the dataset can be visualized with show_mnist_digit.

For more information see https://github.com/facebookresearch/qmnist.

Details

Downloads the image and label files for the training and test datasets from https://github.com/facebookresearch/qmnist and converts them to a data frame.

Value

Data frame containing the QMNIST digits.

References

Yadav, C., & Bottou, L. (2019, May). Cold Case: The Lost MNIST Digits arXiv preprint arXiv:1905.10498. https://github.com/facebookresearch/qmnist

Examples

## Not run: 
# download the QMNIST data set
qmnist <- download_qmnist()

# first 60,000 instances are the training set
qmnist_train <- head(qmnist, 60000)
# the remaining 60,000 are the test set
qmnist_test <- tail(mnist, 60000)

## End(Not run)

jlmelville/snedata documentation built on Jan. 13, 2024, 2:06 a.m.