wrap_simple_eval: Wrap a simple eval function

Description Usage Arguments Details Value

View source: R/eval_function.R

Description

Transforms an evaluation function valid for a single model, segment and target, into a function that applies on each combination of models, segments and targets.

Usage

1
wrap_simple_eval(simple_eval_fun, unnest = TRUE, ...)

Arguments

simple_eval_fun

function(eval_frame). A function which takes an input data.frame that corresponds to an evaluation frame.

unnest

If false, results are in a list column named "evaluation". If true, results are unnested depending on class of output. Vectors of size >2 are gathered to two columns ("evaluation" and "evaluation_name"), as do lists of size >2, with the difference that the "evaluation" column remains a list column for the later. Data.frames are spread across multiple columns and possibly multiple rows if the data.frame has several rows. Be sure to insert a header row in this case. Vectors and lists of size 1 creates an "evaluation name" column only if they are named.

...

Additional named arguments passed to simple_eval_fun. When wrapping the function, these arguments are constant over all (model x target_type x segment) combinations.

Details

The input function can be multi-output. If unnest = FALSE, the output is encapsulated into a list column. If unnest = TRUE, then the results are unnested, in a way depending of the class of the output. See Assesser documentation for additional details on unnesting.

Value

An evaluation function that can be used on any eval_frame type data.frame.


signaux-faibles/MLsegmentr documentation built on Aug. 29, 2019, 2:22 p.m.