Defines the spam dataset commonly used in machine learning.

spam_dataset(
  url = "https://hastie.su.domains/ElemStatLearn/datasets/spam.data",
  download = FALSE,
  transform = NULL,
  target_transform = NULL
)

Arguments

url

A character string representing the URL of the dataset.

download

Logical; whether to download the dataset. Defaults to FALSE.

transform

Function to apply transformations to the features. Defaults to NULL.

target_transform

Function to apply transformations to the labels. Defaults to NULL.

Value

A torch::dataset object for the spam dataset.

Examples

if (FALSE) { # \dontrun{
# Simple usage:
ds <- spam_dataset(download = TRUE)
ds[1]
} # }