Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 212043

GLM split data between train and test 70 30 respectively

$
0
0

split data in R train_data has rows of 891 test_data has rows of 418 i would like to split data 70% for train_data and 30% for test_data to get glm model This is how I am doing

split_testD <- sample(2, nrow(test_data), replace = TRUE, prob = c(0.7,0.3))
split_trainD <- sample(2, nrow(train_data), replace = TRUE, prob = c(0.7,0.3))

But for some reason when i try to get glm model it gets me less rows for test_data which is not right


Viewing all articles
Browse latest Browse all 212043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>