plot_roc: creates a ROC plot

Description Usage Arguments Value Examples

View source: R/plot_roc.R

Description

Takes in a vector of prediction labels and a vector of prediction probabilities.

Usage

1
plot_roc(y_label, predict_proba)

Arguments

y_label

a numeric vector contains the validation set label, all elements should be either 0 or 1

predict_proba

a numberic vector contains the prediction probabilities

Value

A plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
library(RMLViz)
set.seed(420)

num.samples <- 100
weight <- sort(rnorm(n=num.samples, mean=172, sd=29))
bese <- ifelse(test=(runif(n=num.samples) < (rank(weight)/num.samples)),
               yes=1, no=0)

glm.fit=glm(obese ~ weight, family=binomial)
obese_proba <- glm.fit$fitted.values

plot_roc(obese, obese_proba)

## End(Not run)

UBC-MDS/RMLViz documentation built on April 1, 2020, 4:35 a.m.