Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
glmnet.mock <- function(formula=y~., family="gaussian", data, ...){ <- strsplit(family, "\\(|\\)")[[1]]
family <-[1]
if(length( >=2) link <-[2]
else link <- "identity"
return(glmnet(x=model.matrix(formula, data),
y=get(link)(model.response(model.frame(formula, data))),
family = family,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment