21  Working with an SGE scheduler

If you are working on a cluster with an SGE scheduler, you can use the sge_submit() function to submit jobs to the scheduler. This function generates the required R script and shell script, and submits to the SGE scheduler.

Arguments:

dat <- read("some_data.csv")
resultsdir <- "./results"
logdir <- "./sge_logs"
mod <- sge_submit(
    {
        train_cv(
            dat,
            alg = "lightgbm",
            alg.params = list(num_leaves = 16, learning.rate = 0.01),
            outer.resampling = setup.resample(
                resampler = "kfold", n.resamples = 10, seed = 2023
            ),
            outdir = file.path(resultsdir, "mod_LightGBM16")
        )
    },
    obj_names = c("dat", "resultsdir"),
    packages = "rtemis",
    n_threads = 12,
    sge_out = logdir,
    h_rt = "10:00:00",
    system_command = "module load r"
)