Current situation
any predictor being of type character() makes tabnet_* fails with the following error
Error in torch_tensor_cpp(data, dtype, device, requires_grad, pin_memory) :
R type not handled
Expected situation
character columns shall be turned into factors with a warning to the end-user about the number of levels discovered
Workaround
use a character to factor transformation upfront using tabnet_* functions
library(dplyr)
#>
library(tabnet)
data("billboard", package = "tidyr")
billboard_fct <- billboard %>% mutate_if(is.character, as.factor)
model <- tabnet_fit(wk1 ~ ., data = billboard_fct)
Created on 2023-06-25 with reprex v2.0.2
ReprEx
library(tabnet)
data("billboard", package = "tidyr")
model <- tabnet_fit(wk1 ~ ., data = billboard)
#> Error in torch_tensor_cpp(data, dtype, device, requires_grad, pin_memory): R type not handled
Created on 2023-06-25 with reprex v2.0.2