plot.glmnetSE {glmnetSE} | R Documentation |
Plot ROC Curve of a fitted glmnetSE Model on Test Data
Description
Plot the ROC curve of a fitted model glmnetSE
(family binomial
and performance metric auc
) on supplied test data.
Usage
## S3 method for class 'glmnetSE'
plot(x, ...)
Arguments
x |
A model of the class |
... |
Additional arguments affecting the plot produced. |
Value
The ROC curve of a glmnetSE
object.
Examples
# Generate dichotom variable
swiss$Fertility <- ifelse(swiss$Fertility >= median(swiss$Fertility), 1, 0)
# Generate a train and test set
set.seed(1234)
train_sample <- sample(nrow(swiss), 0.8*nrow(swiss))
swiss.train <- swiss[train_sample, ]
swiss.test <- swiss[-train_sample, ]
# Estimate model
glmnetSE.model <- glmnetSE(data=swiss.train, cf.no.shrnkg = c("Education"),
alpha=seq(0.1,0.9,0.1), method = "10CVoneSE", test = swiss.test, seed = 123,
family = "binomial", perf.metric = "auc", ncore = 2)
# Plot ROC curve of the fitted model on swiss.test data
plot(glmnetSE.model)
[Package glmnetSE version 0.0.1 Index]