plotROC: Plot ROC curves

Description Usage Arguments Value Examples

View source: R/analysis_wrapper.R

Description

This function plots ROC curves and AUC values based on the results of analyzeUJ function.

Usage

1
plotROC(values, type, err)

Arguments

values

the values created in analyzeUJ function for a specific method. Input could be, for example, result$performance$Lasso.

type

an optional character string defining the type of ROC curve desired. Default is 'avg'.

avg: ROC curve averaged over all folds of k-fold cross-validation.

each: ROC curves for each fold of k-fold cross-validation.

err

an optional logical value True or False. Defining if error bar around averaged ROC curve is desired (only if type=avg). Default is True.

Value

Function plots the desired ROC curve including AUC value.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data = data.frame('id'=rep(c(1:5), each=600),
                  'type'=rep(c('Var1', 'Var2', 'Var3'), times=1000),
                  'value'=sample(c(0,1), 3000, T),
                  'date'=rep(seq(as.Date("2000/1/1"), by = "day", length.out=60), each=50))


# use function to create rectangle version of user journey
dat = reshapeData(data, parallel=T, cores=2, na.rm=F)

# use function to analyze data
res = analyzeUJ(dat, target="Var1", missing="median/mode", task="classification", ROC=T)

# use plot function
plotROC(res$performance$Lasso, type="avg", err=T)
{
  }

LoneWolf6/UJ-Analysis documentation built on Sept. 16, 2020, 4:59 a.m.