yr2: YogiRoc2 object constructor

View source: R/yr2.R

yr2R Documentation

YogiRoc2 object constructor

Description

YogiRoc2 object constructor

Usage

yr2(truth, scores, names = colnames(scores), high = TRUE)

Arguments

truth

a boolean vector indicating the classes of the reference set

scores

a matrix of scores, with rows for each entry in truth, and one column for each predictor

names

the names of the predictors

high

a boolean vector indicating for each predictor whether its scoring high-to-low (or low-to-high)

Value

a yogiroc2 object

Examples

#generate fake data
truth <- c(rep(TRUE,10),rep(FALSE,8))
scores <- cbind(
  pred1=c(rnorm(10,1,0.2),rnorm(8,.9,0.1)),
  pred2=c(rnorm(10,1.1,0.2),rnorm(8,.9,0.2))
)
#create yogiroc2 object
yrobj <- yr2(truth,scores)
#draw PRC curve
draw.prc(yrobj)
#calculate recall at 90% precision
recall.at.prec(yrobj,0.9)

jweile/yogiroc documentation built on Jan. 15, 2024, 2:47 a.m.