df_to_tensor | R Documentation |
This function prepares a dataframe for a tensorsem model. It first converts the variables to a design matrix, then centers it, and lastly converts it to a torch_tensor
df_to_tensor(df, dtype = NULL, device = NULL)
df |
data frame |
dtype |
data type of the resulting tensor |
device |
device to store the resulting tensor on |
Torch tensor of scaled and processed data
torch::torch_tensor()
, stats::model.matrix()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.