Description Usage Arguments Value Author(s) Examples
View source: R/makeBmrsExtraction.R
Compute and extract relevant information from a batch of benchmark experiments. This extraction can then be used to produce various plots.
1 | makeBmrsExtraction(benchmarkResult, tasks, tasks_sids, as.df = TRUE)
|
benchmarkResult |
an object of class |
tasks |
a list which elements are of class |
tasks_sids |
a list which elements are integer vectors containing the sids of the used stations of each task. This list is provided as an output element of the |
as.df |
a boolean specifying if the result must be returned as a single dataframe rather than list of lists. Default is |
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 data.frame
if parameter as.df
is set to TRUE
. If set to FALSE
, the function returns a list which elements are dataframes
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 49 50 | ## 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)
# Keep the relevant information
myBmrsBatch = myBmrsBatch$output$value
# Get the extraction from myBmrsBatch
myBmrsExtraction = makeBmrsExtraction(myBmrsBatch, myTasks, myUsedSids, as.df = TRUE)
# Keeping the relevant information
myBmrsExtraction = myBmrsExtraction$output$value
# Get an excerpt of the output
head(myBmrsExtraction)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.