| get_fscore | R Documentation |
This function calculates the F-score, precision, recall, and specificity for a given knowledge matrix at a specified threshold. It uses the concept of true positives, false positives, and false negatives, determined from the knowledge matrix and an optional gold lexicon. The function is useful for evaluating the performance of a model in terms of its ability to correctly identify associations between words and referents.
get_fscore(m, threshold, gold_lexicon = NULL)
m |
A matrix representing the knowledge matrix with words as rows and referents as columns. |
threshold |
A numeric value representing the threshold for considering an association between a word and a referent as positive. |
gold_lexicon |
Optional; a data frame or list where each row/element represents a word-object pair in the gold lexicon. If provided, it is used to calculate true positives, false positives, and false negatives. |
A tibble with columns for threshold, precision, recall, specificity, and F-score.
dat <- xsl_datasets[[1]]
x <- xsl_run(baseline(), dat)
mat <- x$fits[[1]]$matrix
lex <- list(words = rep(1:18), objects = rep(1:18))
get_fscore(mat, 0.5, lex)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.