spam_dataset: Spam Dataset Loader

spam_datasetR Documentation

Spam Dataset Loader

Description

Defines the spam dataset commonly used in machine learning.

Usage

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

## Not run: 
# Simple usage:
ds <- spam_dataset(download = TRUE)
ds[1]

## End(Not run)

torchdatasets documentation built on April 29, 2026, 9:07 a.m.