Created
July 18, 2020 20:56
Star
You must be signed in to star a gist
step1_for_predicting_linear_model_by_karanshah
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
set.seed(123) # setting seed to reproduce results of random sampling | |
trainingRowIndex <- sample(1:nrow(newdata2), 0.7*nrow(newdata2)) # training and testing: 70/30 split | |
trainingData <- newdata2[trainingRowIndex, ] # training data | |
testData <- newdata2[-trainingRowIndex, ] # test data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment