Calculate AUROC and AUPRC

calc_aucs(trained_model, test_data, outcome_colname, outcome_value)

Arguments

trained_model

trained model from caret

test_data

held out test data: dataframe of outcome and features

outcome_colname

Column name as a string of the outcome variable (default NULL; will be chosen automatically).

outcome_value

Outcome value of interest as a string (default NULL; will be chosen automatically).

Value

List of auroc and auprc values

Author

Zena Lapp, zenalapp@umich.edu

Kelly Sovacool, sovacool@umich.edu

Examples

calc_aucs(trained_model_mini, test_data_sm, "dx", "cancer")
#> $auroc #> [1] 0.5710526 #> #> $auprc #> [1] 0.5438684 #>