Last active
May 22, 2017 12:06
-
-
Save sizhky/49628bad121c662194018e16c91a4a77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test_train_split <- function(data, train_frac = 0.66){ | |
library(caret) | |
inTrain <- createDataPartition(1:nrow(data), p = train_frac, list = FALSE) | |
training <- data[inTrain,] | |
testing <- data[-inTrain,] | |
return(list(train = training, test = testing)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment