样本的抽样 本质 对index做抽样
Case I: Bootstrap
folds = sample(1:1000, 1000, replace = T) # 可用 length(unique(folds))/1000 近似于 0.632 验证
Case II: Hold-out 交叉验证
folds = sample(c(TRUE, FALSE), 1000, replace = TRUE, prob = c(0.25, 0.75))
K = 10 # 折交叉验证
folds = sample(1:10, 1000, replace = TRUE )