# \donttest{
# check python module dependencies
if (reticulate::py_module_available("torch") &
reticulate::py_module_available("numpy") &
reticulate::py_module_available("sklearn") &
reticulate::py_module_available("scipy")) {
# set the random seed
set.seed(100)
# simulate some data
df1 <- data_simulation(n=100,beta=c(1,1,1),w=0.3,
sigma=0.1,delta=10.0,seed=100)
# the cross-validation and bootstrap takes a long time
DNN_model_output <- DNN_model(y ~ X1 + X2 + X3 - 1,
data = df1,
model = "ST-GX-D",
num_epochs = 5,
verbatim = FALSE,
CV = TRUE,
CV_K = 2,
bootstrap = TRUE,
bootstrap_B = 2,
bootstrap_num_epochs = 5,
U_new = TRUE,
U_min = -4.0,
U_max = 4.0)
print(DNN_model_output)
}
# }
Run the code above in your browser using DataLab