Description Usage Arguments Value Author(s) Examples
Tune the cutoffs for different likelihood groups given predicted score, response and a vector of likelihood values
1 | tune_cutoff(test, y, likelihood)
|
test |
a vector of predicted score from model |
y |
a vector of response, |
likelihood |
a vector of likelihood values |
an object of class "tune_cutoff
" is returned, which is a list with the ingredients of the tuning process.
Hui Lin, longqiman@gmail.com
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.