EMNIST Dataset

emnist_dataset(
  root = tempdir(),
  split = "balanced",
  transform = NULL,
  target_transform = NULL,
  download = FALSE
)

Arguments

root

Character. Root directory for dataset storage (default folder: root/emnist/processed/).

split

Character. Dataset split to use. One of "byclass", "bymerge", "balanced", "letters", "digits", or "mnist". Default is "balanced".

transform

Optional function to transform input images.

target_transform

Optional function to transform labels.

download

Logical. Whether to download the dataset if it is not found locally. Default is FALSE.

Value

An EMNIST dataset object.

Details

Loads the EMNIST dataset, a set of handwritten digits and letters with multiple splits:

  • "byclass": 62 classes (digits + uppercase + lowercase)

  • "bymerge": 47 classes (merged uppercase and lowercase letters)

  • "balanced": 47 classes balanced between digits and letters

  • "letters": 26 letter classes only

  • "digits": 10 digit classes only

  • "mnist": classic 10 digit classes like the original MNIST dataset

Examples

if (FALSE) { # \dontrun{
emnist <- emnist_dataset(split = "balanced", download = TRUE)
first_item <- emnist[1]
# image in item 1
first_item$x
# label of item 1
first_item$y
} # }