Skip to content

Instantly share code, notes, and snippets.

@zunman
Created September 11, 2016 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zunman/4035b5f2f870efc5f05bf5c122c1f973 to your computer and use it in GitHub Desktop.
Save zunman/4035b5f2f870efc5f05bf5c122c1f973 to your computer and use it in GitHub Desktop.
#perform split
splitIndex <- createDataPartition(data.DTM$label, p = .50, list = FALSE, times = 1)
trainset <- data.DTM[ splitIndex,]
testset <- data.DTM[-splitIndex,]
traindata <- data[ splitIndex,]
testdata <- data [-splitIndex,]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment