powered by
For an x/y interface, matrix_to_dataset() converts the data to proper encodings then formats the results for consumption by torch.
matrix_to_dataset()
torch
matrix_to_dataset(x, y)
An R6 index sampler object with classes "training_set", "dataset", and "R6".
A numeric matrix of predictors.
A vector. If regression than y is numeric. For classification, it is a factor.
y
Missing values should be removed before passing data to this function.
if (torch::torch_is_installed()) { matrix_to_dataset(as.matrix(mtcars[, -1]), mtcars$mpg) }
Run the code above in your browser using DataLab