create_comparison.RdJoin the gold standard and the predicted results in one table based on the document id and the label id.
create_comparison(
predicted,
gold_standard,
doc_groups = NULL,
label_groups = NULL,
graded_relevance = FALSE,
propensity_scored = FALSE,
label_distribution = NULL,
ignore_inconsistencies = options::opt("ignore_inconsistencies")
)Multi-label prediction results. Expects a data.frame with
columns "label_id", "doc_id".
Expects a data.frame with columns "label_id",
"doc_id".
A two-column data.frame with a column "doc_id" and a
second column defining groups of documents to stratify results by. It is
recommended that groups are of type factor so that levels are not
implicitly dropped during bootstrap replications.
A two-column data.frame with a column "label_id"
and a second column defining groups of labels to stratify results by.
Results in each stratum will restrict gold standard and predictions to the
specified label groups as if the vocabulary was consisting of the label
group only. All modes "doc-avg", "subj-avg", "micro" are supported
within label strata. Nevertheless, mixing mode = "doc-avg" with
fine-grained label strata can result in many missing values on
document-level results. Also rank-based thresholding (e.g. top 5) will
result in inhomogeneous numbers of labels per document within the defined
label strata. mode = "subj-avg" or mode = "micro" can be more
appropriate in these circumstances.
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]\).
Logical, whether to use propensity scores as weights.
Expects a data.frame with columns "label_id",
"label_freq", "n_docs". label_freq corresponds to the number of
occurences a label has in the gold standard. n_docs corresponds to
the total number of documents in the gold standard.
Warnings about data inconsistencies will be silenced. (Defaults to FALSE, overwritable using option 'casimir.ignore_inconsistencies' or environment variable 'R_CASIMIR_IGNORE_INCONSISTENCIES')
A data.frame with columns "label_id", "doc_id", "suggested",
"gold".