Description Usage Arguments Details Value Author(s) Examples
View source: R/makeBmrsBatch.R
make a (multicore) mlr benchmark experiment of your learner(s) on your task(s)
1 2 3 4 |
tasks |
a list which elements are object of class |
learners |
a list which elements are object of class |
measures |
a list of the mlr performance metrics you want to get. Default is |
keep.pred |
a boolean specifying if you want to keep the bmr preds. defaut = |
models |
a boolean specifying if you want to keep the bmr models. defaut = |
level |
a character specifying the paralelllization level. Default = "mlr.benchmark" |
cpus |
an integer specifying the number of cpus to use for the benchamrk. Default is 4 |
temp_dir |
a character specifying the path of an exising directory where you want to save the bmr temporary outpus. |
prefix |
a character specifying the prefix you want to add to each bmr temporary file name. |
groupSize |
a numeric specifying the number of tasks you want to benchamrk in a single batch. If |
removeTemp |
a boolean specifying if the temporary .rds generated by the function must be deleted at the end of the process. |
crash |
a boolean. |
resampling |
a character specifying the type of mlr's Cross-Validation strategy. Default = |
The function handles learners error. See mlr::configureMlr()
.
A 2 elements named list
snitch
: a boolean. Is TRUE
if function has provided the expected result. Is FALSE
is function throws an error
output
: a named list which elements are :
value
: an element of class mlr::benchmark()
condition
: a character specifying the condition encountered by the function : success, warning, or error.
message
: a character specifying the message relative to the condition.
Thomas Goossens
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | ## Not run:
# load magrittr for pipe use : %>%
library(magrittr)
# create the dataset
myDataset = makeDataset(
dfrom = "2017-03-04T15:00:00Z",
dto = "2017-03-04T18:00:00Z",
sensor = "tsa")
# extract the list of hourly sets of records
myDataset = myDataset$output$value
# create the tasks
myTasks = purrr::map(myDataset, makeTask, target = "tsa")
# extract the used sids of each task from the outputs
myUsedSids = myTasks %>% purrr::modify_depth(1, ~.$output$stations$used)
# extract the tasks from the outputs
myTasks = myTasks %>% purrr::modify_depth(1, ~.$output$value$task)
# Conduct a batch of benchmarks experiments without saving temp files
myBmrsBatch = makeBmrsBatch(
tasks = myTasks,
learners = agrometeorLearners,
measures = list(mlr::rmse),
keep.pred = TRUE,
models = FALSE,
groupSize = NULL,
level = "mlr.benchmark",
resamplings = "LOO",
cpus = 1,
prefix = NULL,
temp_dir = NULL,
removeTemp = FALSE,
crash = FALSE)
# Keep the relevant information
myBmrsBatch = myBmrsBatch$output$value
# make a plot from the myBmrsBatch
mlr::plotBMRBoxplots(myBmrsBatch,
measure = mlr::rmse,
order.lrn = getBMRLearnerIds(myBmrsBatch),
pretty.names = FALSE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.