Skip to content

Instantly share code, notes, and snippets.

@gerrich
Created July 16, 2015 21:48
Show Gist options
  • Save gerrich/07935114dcf41590dcc3 to your computer and use it in GitHub Desktop.
Save gerrich/07935114dcf41590dcc3 to your computer and use it in GitHub Desktop.
R data.frame factor oneHot encoding
X = sparse.model.matrix(
as.formula(
paste("Hazard~", paste(colnames(ts.train), sep = "_", collapse=" +"))
), data = ts.train)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment