USPSdigits {IMIFA} | R Documentation |
USPS handwritten digits
Description
Training and test sets for the United States Postal Service (USPS) handwritten digits data, with 8-bit 16x16 grayscale grid representations of image scans of the digits "0" through "9".
Usage
data(USPSdigits)
Format
A list of length 2 with the following elements, each one a data.frame
:
train
The training set of 7,291 digits.
test
The test set of 2,007 digits.
Each data.frame
contains the known digit labels in its first column.
The remaining 256 columns give the concatenation of the 16x16 grid.
Pixels are scaled such that [-1,1] corresponds to [white,black].
References
Hastie, T., Tibshirani, R., and Friedman, J. (2001). The Elements of Statistical Learning (2nd edition). Springer Series in Statistics. New York, NY, USA: Springer.
See Also
Examples
# Load the data and record the labels
data(USPSdigits, package="IMIFA")
ylab <- USPSdigits$train[,1]
train <- USPSdigits$train[,-1]
# Examine the effect of discarding peripheral pixels
SDs <- apply(train, 2, sd)
ind <- SDs > 0.7
dat <- train[,ind]
hist(SDs, breaks=200, xlim=c(0, 1))
rect(0.7, 0, 1, 12, col=2, density=25)
show_digit(ind) # retained pixels are shown in black
[Package IMIFA version 2.2.0 Index]