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
# Method 1: Easiest and does not require any library | |
data(mtcars) | |
## 75% of the sample size | |
smp_size <- floor(0.75 * nrow(mtcars)) | |
## set the seed to make your partition reproducible | |
set.seed(123) | |
train_ind <- sample(seq_len(nrow(mtcars)), size = smp_size) |