evals: Get one or more evals from a simulation

Description Usage Arguments See Also Examples

View source: R/get-from-simulation.R

Description

Returns either the Evals object itself or a reference to it.

Usage

1
evals(sim, ..., subset = NULL, index, methods, reference = FALSE)

Arguments

sim

a simulation object

...

logical conditions to specify a subset of models. Conditions can only involve params of model that have length 1 and are of class numeric or character.

subset

a vector of integers indexing the models or a vector of model names. To select models based on parameter values, use .... However, using ... is slower than using subset.

index

a vector of positive integers specifying which draws' objects are desired. If missing, then all draws' evals are returned.

methods

character vector of method names of interest. If missing, then all methods' evals are returned

reference

whether to return the ModelRef or the Model object itself

See Also

as.data.frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## 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 = 20) %>%
   simulate_from_model(nsim = 50, index = 1:3) %>%
   run_method(my_example_method) %>%
   evaluate(my_example_loss)
 # then we could get the metric evaluated on the method's output:
 e <- evals(sim)
 # we can export it as a data.frame
 as.data.frame(e)
 # or we can get at a particular draw-method-metric triplet
 e@evals$`my-method`$r1.1$myloss
 
## End(Not run)

simulator documentation built on May 29, 2017, 11:29 a.m.