Rename metric names for generalised precision etc. The output will be renamed if:

graded_relevance == TRUE

prefixed with "g-" to indicate that metrics are computed with graded relevance.

propensity_scored == TRUE

prefixed with "ps-" to indicate that metrics are computed with propensity scores.

!is.null(k)

suffixed with "@k" to indicate that metrics are limited to top k predictions.

rename_metrics(
  res_df,
  k = NULL,
  propensity_scored = FALSE,
  graded_relevance = FALSE
)

Arguments

res_df

A data.frame with a column "metric" containing metric names "f1", "prec", "rec", "rprec".

k

An integer limit on the number of predictions per document to consider. Requires a column "score" in input predicted.

propensity_scored

Logical, whether to use propensity scores as weights.

graded_relevance

A logical indicator for graded relevance. Defaults to FALSE for binary relevance. If set to TRUE, the predicted data.frame should contain a numeric column "relevance" with values in the range of \([0, 1]\).

Value

The input data.frame res_df with renamed metrics for generalised precision etc.