View source: R/threshperf_plots.R
threshperf | R Documentation |
This function is used by the threshperf_plot
function. This is based on
the threshold_perf()
function from the probably
package (a part of tidymodels
)
but expands the capability to allow for the range of metrics to include positive and
negative predictive value.
threshperf(
df,
outcome,
prediction,
positive = "has_sepsis",
thresholds = NULL,
statistics = c("sens", "spec", "ppv", "npv"),
prevalence = NULL
)
df |
The df as a data.frame. |
outcome |
A character string containing the name of the column containing the outcomes (expressed as 0/1s). |
prediction |
A character string containing the name of the column containing the predictions. |
thresholds |
Numeric vector of thresholds at which the performance
statistics are calculated. Default is |
statistics |
Character vector of statistics to include.
Select among |
prevalence |
Specify the prevalence of outcome for case-control studies.
Default is |
A data.frame containing the columns .threshold
, .metric
,
.estimator
, and .estimate
data(single_model_dataset)
threshperf(single_model_dataset, outcome = 'outcomes', prediction = 'predictions')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.