spam_dataset | R Documentation |
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
)
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. |
A torch::dataset
object for the spam dataset.
## Not run:
# Simple usage:
ds <- spam_dataset(download = TRUE)
loader <- dataloader(ds, batch_size = 32, shuffle = TRUE)
batch <- dataloader_make_iter(loader) %>% dataloader_next()
dim(batch$x)
length(batch$y)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.