hyfe_performance: Evaluate Hyfe's performance based on a set of labelled...

Description Usage Arguments Value

View source: R/hyfe_performance.R

Description

Evaluate Hyfe's performance based on a set of labelled sounds.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
hyfe_performance(
  detections,
  labels,
  offsets,
  offset_cutoff = 3,
  prediction_threshold = 0.7,
  n3_cutoff = 10,
  quality_cutoff = 0.95,
  remove_tests = NULL,
  toplot = TRUE,
  verbose = TRUE
)

Arguments

detections

A dataframe of Hyfe detections. This dataframe requires these columns: alias (research/device ID); timestamp (with a numeric timestamp); n_peaks (the number of peaks occurring at the time represented by the timestamp; this can just be 1 if you don't know); and prediction_score (0-1).

labels

A dataframe with analyst labels. Required columns: test (numeric ID for each test labeled); timestamp (numeric timestamp for the cough-second); label (best label for this cough-second, 1 - 3, using the Hyfe 4-tier system: 1 = a disputable cough, possibly fake; 2 = definitley a cough but barely audible; 3 = a clear authentic cough); n1 (if this cough second was labeled category 1 by any analysts, this value is 1; if not it is 0); same for n2 (category 2) and n3 (category 3); n_labels provides the number of labels that occurred within this cough-second; n_analysts provides the number of analysts who have reviewed this test; valid indicates whether this cough-second should be included in the analysis (TRUE or FALSE).

offsets

A dataframe of time offsets, in seconds, for the Hyfe detections in each test represented in the labels dataset. Each row is a test. Required fields are: alias (research/device ID); test (numeric ID for the test); offset (seconds by which to adjust Hyfe timestamp; if postivie, Hyfe timestamps will increase; if negative, they will decrease).

offset_cutoff

A number indicating the allowable difference, in seconds, between a Hyfe detection and a label timestamp.

prediction_threshold

Cough prediction score threshold.

n3_cutoff

Minimum number of category 3 coughs that must be labeled for a test in order for that test to be included in the calculation of performance metrics.

quality_cutoff

Minimum quality of a test in order for that test to be included in the estimation of performance metrics. Quality is defined as the fraction of cough-seconds that are category 3.

remove_tests

Numeric vector providing the IDs for any tests you want to remove from the performance analysis.

toplot

Plot diagnostic plots?

verbose

Plot status updates?

Value

A list with various summaries of the results.


hyfe-ai/hyfer documentation built on Dec. 20, 2021, 5:53 p.m.