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(thresh, mat, fscore_only = T, gold_lexicon = c(), verbose = F)
thresh |
A numeric value representing the threshold for considering an association between a word and a referent as positive. |
mat |
A matrix representing the knowledge matrix with words as rows and referents as columns. |
fscore_only |
Logical; if TRUE, only the F-score is returned. If FALSE, a data frame with precision, recall, specificity, and F-score for each threshold is returned. |
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. |
verbose |
Logical; if TRUE, additional details about true positives, false positives, and false negatives are printed. |
If fscore_only
is TRUE, returns a single numeric value representing the F-score. If fscore_only
is FALSE, returns a tibble (data frame) with columns for threshold, precision, recall, specificity, and F-score at each threshold.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.