【发布时间】:2019-12-12 10:39:39
【问题描述】:
我正在使用 Keras,我想制作 10 个不同的训练和测试样本,以对这些样本重复拟合函数。
for (i in 1:10) {
## 75% of the sample size
smp_size <- floor(0.8 * nrow(cifarSmall$x))
## set the seed to make your partition reproducible
set.seed(123)
train_ind <- sample(seq_len(nrow(cifarSmall$x)), size = smp_size)
train_x <- cifarSmall$x[train_ind,,,]
train_y <- cifarSmall$y[train_ind]
test_x <- cifarSmall$x[-train_ind,,,]
test_y <- cifarSmall$y[-train_ind]
conjuntos_train_x[i] <- c(train_x)
}
【问题讨论】:
-
我想要做的是 80-20 的 Hold-out 10 次,所以我想要 10 个不同的训练集和测试集