null_ROC: null_ROC

Description Usage Arguments Value See Also Examples

View source: R/null_ROC.R

Description

Return the true positive rate and false positive rate for each threshold in the prediction. Need to plot ROC curve

Usage

1
null_ROC(actual, predicted, weight = NULL, na.rm = FALSE)

Arguments

actual

Array[Numeric] - 0 or 1 - Values we are aiming to predict.

predicted

Array[Numeric] / DataFrame[Numeric] - Between 0 and 1 - Values that we have predicted.

weight

Optional: Array[Numeric] - Weighting of predictions. If NULL even weighting is used

na.rm

logical. Should missing values be removed?

Value

dataframe with columns Threshold - value of the threshold TP_Rate - True positive rate FP_Rate - False positive rate

See Also

plot_ROC and metric_ROC

Examples

1
2
3
4
data <- data.frame(x1=runif(100), x2=runif(100), noise=rnorm(100, sd=0.2)) %>%
  mutate(target=ifelse(x1 + noise>0.5, 1, 0))

null_ROC(actual=data$target, predicted=data$x1)

gloverd2/admr documentation built on Dec. 2, 2020, 11:16 p.m.