tune_cutoff: Tune the cutoffs for different likelihood groups

Description Usage Arguments Value Author(s) Examples

Description

Tune the cutoffs for different likelihood groups given predicted score, response and a vector of likelihood values

Usage

1
tune_cutoff(test, y, likelihood)

Arguments

test

a vector of predicted score from model

y

a vector of response, y need to be the same length of test

likelihood

a vector of likelihood values

Value

an object of class "tune_cutoff" is returned, which is a list with the ingredients of the tuning process.

Author(s)

Hui Lin, longqiman@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
data("sim1_da1")
trainx = sim1_da1[,1:50]
trainy = sim1_da1$y
library(glmnet)
fit <- cv.glmnet(as.matrix(trainx), trainy, family = "binomial")
test <- predict(fit, as.matrix(trainx), type = "link", s = "lambda.min")
test <- as.vector(test)
summary(test)
likelihood <- c(0.2, 0.5, 0.8)
y <- trainy
x <- tune_cutoff(test = test, y = y, likelihood = likelihood)
str(x)
plot.tune.cutoff(x)

## End(Not run)

happyrabbit/DataScienceR documentation built on May 17, 2019, 2:41 p.m.