This function splits the input data and response variables into training and testing parts.
Examples
dat <- gendata_MLR(n = 100, p = 10)
dat <- split_data(dat$X, dat$y, p.train = 0.7)
dim(dat$x.tr)
#> [1] 70 10
dim(dat$x.te)
#> [1] 30 10
This function splits the input data and response variables into training and testing parts.
dat <- gendata_MLR(n = 100, p = 10)
dat <- split_data(dat$X, dat$y, p.train = 0.7)
dim(dat$x.tr)
#> [1] 70 10
dim(dat$x.te)
#> [1] 30 10