gtd_pr: Plot Precision and Recall scores

Description Usage Arguments Details Value

View source: R/pr.r

Description

Uses the gold standard in the gold_matches data to calculate Precision and Recall scores. Results are calculated separately for the article level (does the article have at least one GTD match) and match level (each individual match of an article to a GTD event). Results are also calculated for different Similarity thresholds, which will be plotted on the x-axis.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gtd_pr(
  g,
  weight_range,
  steps,
  weights = NULL,
  weight_col = "weight",
  filter = NULL,
  exclude_added = T,
  gtd_id_filter = NULL
)

Arguments

g

An edgelist, as created with newsflow.compare

weight_range

The range of weight to plot on the x axis

steps

The number of ticks on the x axis

weights

Optionally, provide a vector of weights. This overrides the weight_range and steps arguments

weight_col

the name of the column with the weight scores

filter

Optionally, a logical vector indicating which rows of g$d to use.

Details

The results are also returned as a list with data.frames. See gold_matches$description for details on the gold standard.

Value

A plot an a list with data.frames


maskedforreview/gtdnews documentation built on April 12, 2021, 11:53 a.m.