📅  最后修改于: 2022-03-11 14:55:51.135000             🧑  作者: Mango
library(caTools)
sample <- sample.split(data$y, SplitRatio = 0.7)
train_data <- subset(data, sample == TRUE)
test_data <- subset(data, sample == FALSE)