Last active
August 29, 2015 14:05
-
-
Save sulrich/21f1453ba437718807e3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # the behavior of the createDataPartition() operation is a little | |
| # counter-intuitive - you're actually manipulating the the following command | |
| # will select the index according to seaflow$pop, and store them in the vector | |
| # trIndex | |
| trIndex <- createDataPartition(foo$pop, p = 0.5, list = FALSE) | |
| # then use the vector trIndex to split the data into training data frame and | |
| # testing data frame. | |
| trainDF <- foo[ trIndex,] | |
| testDF <- foo[-trIndex,] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment