Make a table of a metric for each pair of models and methods

Share:

Description

Each row of the table corresponds to a different model and each column to a different method. The metric must be a scalar. The way in which standard error is shown (or not shown) is controlled by se_format.

Usage

1
2
3
4
5
tabulate_eval(object, metric_name, method_names = NULL, caption = NULL,
  center_aggregator = NULL, spread_aggregator = NULL,
  se_format = c("Paren", "PlusMinus", "None"), output_type = "latex",
  format_args = list(nsmall = 0, digits = NULL, scientific = FALSE),
  na_string = "--")

Arguments

object

an object of class Simulation, Evals, or listofEvals. Each evals object should just differ by model_name.

metric_name

the name of a metric to tabulate. Must be scalar valued.

method_names

character vector indicating methods to include in table. If NULL, then will include all methods found in object's evals.

caption

caption of plot

center_aggregator

When NULL (which is default), the sample mean aggregator is used. User can write specialized aggregators (see definition of class Aggregator) as necessary, for example, when the evaluated metric is not scalar-valued.

spread_aggregator

When NULL (which is default), the sample mean aggregator is used. User can write specialized aggregators (see definition of class Aggregator) as necessary, for example, when the evaluated metric is not scalar-valued. Set spread_aggregator to NA to hide error bars.

se_format

format of the standard error

output_type

see kable's argument format for options. Default is "latex" but other options include "html" and "markdown"

format_args

arguments to pass to the function format

na_string

what to write in table in place of NA

Details

Uses knitr's function kable to put table in various formats, including latex, html, markdown, etc.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
 # suppose previously we had run the following:
 sim <- new_simulation(name = "normal-example",
                       label = "Normal Mean Estimation",
                       dir = tempdir()) %>%
   generate_model(make_my_example_model,
                  n = list(10, 20, 30),
                  vary_along = "n") %>%
   simulate_from_model(nsim = 50, index = 1:3) %>%
   run_method(my_example_method) %>%
   evaluate(my_example_loss)
   # then we could plot this
   tabulate_eval(sim, "myloss")
 
## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.