Description Usage Arguments Examples
Feature selection using only LASSO.
1 |
d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (d)
{
library(glmnet)
y <- d$Status
x <- as.matrix(d[, -c(1, dim(d)[2])])
l <- cv.glmnet(x, y, nfolds = 10, family = "binomial")
lambdam <- l$lambda[which(l$cvm == min(l$cvm))]
m <- glmnet(x, y, family = "binomial", lambda = lambdam)
m1 <- glmnet(x, y, family = "binomial")
pdf("LASSO_Plots.pdf")
plot(l)
plot(m1)
dev.off()
c <- rownames(m$beta)[which(!(m$beta == 0))]
return(c)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.