matrix_to_dataset | R Documentation |
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(x, y)
x |
A numeric matrix of predictors. |
y |
A vector. If regression than |
Missing values should be removed before passing data to this function.
An R6 index sampler object with classes "training_set", "dataset", and "R6".
if (torch::torch_is_installed()) {
matrix_to_dataset(as.matrix(mtcars[, -1]), mtcars$mpg)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.