get_auprc: AUPRC Metrics for Predictions

View source: R/metrics.R

get_auprcR Documentation

AUPRC Metrics for Predictions

Description

A function to return AUPRC metrics for predictions vs actual values. Works well when piped to straight from get_predictions().

Usage

get_auprc(predictions, biomarker_values, model = "", threshold = 300)

Arguments

predictions

(list) A list with two elements, 'predictions' and 'panel_lengths', as produced by the function get_predictions().

biomarker_values

(dataframe) A dataframe with two columns, 'Tumor_Sample_Barcode' and a column with the name of the biomarker in question containing values.

model

(character) The name of the model type producing these predictions.

threshold

(numeric) The threshold for biomarker high/low categorisation.

Value

A dataframe with 5 columns:

  • panel_length: the length of each panel.

  • model: the model that produced the predictions.

  • biomarker: the name of the biomarker in question.

  • stat: the AUPRC values for each panel.

  • metric: a constant character "AUPRC".

Examples

example_auprc <- get_auprc(predictions = get_predictions(example_refit_panel,
new_data = example_tables$val), biomarker_values = example_tmb_tables$val,
model = "Refitted T", threshold = 10)

cobrbra/ICBioMark documentation built on May 4, 2023, 2:16 a.m.