Skip to contents

hr_settings() lists every setting that hr_set() can change: one row per setting of each step's schema, with the value the step resolved it to, whether it was given or left at its default, and what the schema declares about it (default, range, type, tier and evidence). In a chain a setting is named by its path, "step.setting", as in hr_set(), in hr_sweep()'s grid and in the param.* columns of hr_benchmark(): paste(step, param, sep = ".").

Usage

hr_settings(x)

Arguments

x

A step from hr_step(), gr_step() or gr_step_retrieve(), or an arm built by hr_chain().

Value

A data frame with one row per setting: step (the step's name in the chain, or the step's own name), param, value (the resolved value as text), set (TRUE when the value was given rather than left at its default), and from the schema default, range, type, tier, status and source (the evidence for the default, NA when none is declared).

Details

A step with no schema has no rows: its settings are fixed when it is built. Neither has a setting the schema does not name, which a step built with build keeps as a fixed extra (see hr_step()); to change one, build the step again and replace it with hr_chain().

Only steps and chains carry schemas. An arm from gr_arm() is a recipe, whose settings gr_settings_table() lists, and an arm from hr_arm() alone records none, so either is an error of class hr_bad_arm.

The arm attribute hr_settings, which hr_benchmark() turns into param.* columns, is a different thing: it holds only the settings the chain was given, as "step.setting", while this function lists every setting with its resolved value.

Examples

chain <- hr_chain(segment = gr_step("segment"),
                  retrieve = gr_step_retrieve(top_k = 4),
                  read = gr_step("read", reader = "stuff"), name = "checked")
s <- hr_settings(chain)
s[s$set, c("step", "param", "value", "default")]
#>        step  param value    default
#> 21 retrieve  top_k     4          6
#> 35     read reader stuff map_reduce
hr_settings(gr_step_retrieve())[, c("param", "value", "range")]
#>           param   value       range
#> 1         top_k       6  [1, 10000]
#> 2     min_score    -Inf            
#> 3           mmr       1      [0, 1]
#> 4       bm25_k1     1.5     [0, 10]
#> 5        bm25_b    0.75      [0, 1]
#> 6 lexical_blend     0.5      [0, 1]
#> 7        fusion default default|rrf
#> 8         rrf_k      60  [1, 10000]