if (FALSE) {
#check for python and required modules
python_ready()
data("exp_data")
s_deeplearning <- metalearner_deeplearning(data = exp_data,
cov.formula = support_war ~ age + female + income + education
+ employed + married + hindu + job_loss,
treat.var = "strong_leader", meta.learner.type = "S.Learner",
nfolds = 5, algorithm = "adam",
hidden.layer = c(2,2), hidden_activation = "relu",
output_activation = "sigmoid", output_units = 1,
loss = "binary_crossentropy", metrics = "accuracy",
epoch = 10, verbose = 1, batch_size = 32,
validation_split = NULL, patience = NULL,
dropout_rate = NULL, conformal= FALSE, seed=1234)
}
if (FALSE) {
#check for python and required modules
python_ready()
data("exp_data")
t_deeplearning <- metalearner_deeplearning(data = exp_data,
cov.formula = support_war ~ age + female + income + education
+ employed + married + hindu + job_loss,
treat.var = "strong_leader", meta.learner.type = "T.Learner",
nfolds = 5, algorithm = "adam",
hidden.layer = c(2,2), hidden_activation = "relu",
output_activation = "sigmoid", output_units = 1,
loss = "binary_crossentropy", metrics = "accuracy",
epoch = 10, verbose = 1, batch_size = 32,
validation_split = NULL, patience = NULL,
dropout_rate = NULL, conformal= TRUE,
alpha = 0.1,calib_frac = 0.5, prob_bound = TRUE, seed = 1234)
}
Run the code above in your browser using DataLab