平均神经网络 (avNNet) 是所有迭代的平均值吗?

Is an Averaged neural network (avNNet) the average from all iterations?

我在 R 中用 Caret 安装了一个平均神经网络。请参阅下面的代码。术语“平均”是否意味着平均值是基于 1000 个神经网络的结果? (因为在这种情况下有 1000 次迭代)

谢谢。

library(AppliedPredictiveModeling)
data(solubility)

### Create a control funciton that will be used across models. We
### create the fold assignments explictily instead of relying on the
### random number seed being set to identical values.

library(caret)
set.seed(100)
indx <- createFolds(solTrainY, returnTrain = TRUE)
ctrl <- trainControl(method = "cv", index = indx)

################################################################################
### Section 7.1 Neural Networks

### Optional: parallel processing can be used via the 'do' packages,
### such as doMC, doMPI etc. We used doMC (not on Windows) to speed
### up the computations.

### WARNING: Be aware of how much memory is needed to parallel
### process. It can very quickly overwhelm the availible hardware. We
### estimate the memory usuage (VSIZE = total memory size) to be 
### 2677M/core.

library(doMC)
registerDoMC(10)


library(caret)

nnetGrid <- expand.grid(decay = c(0, 0.01, .1), 
                        size = c(1, 3, 5, 7, 9, 11, 13), 
                        bag = FALSE)

set.seed(100)
nnetTune <- train(x = solTrainXtrans, y = solTrainY,
                  method = "avNNet",
                  tuneGrid = nnetGrid,
                  trControl = ctrl,
                  preProc = c("center", "scale"),
                  linout = TRUE,
                  trace = FALSE,
                  MaxNWts = 13 * (ncol(solTrainXtrans) + 1) + 13 + 1,
                  maxit = 1000,
                  allowParallel = FALSE)
nnetTune

plot(nnetTune)

testResults <- data.frame(obs = solTestY,
                          NNet = predict(nnetTune, solTestXtrans))

################################################################################

另请参阅:

https://scientistcafe.com/post/nnet.html

avNNet是同一个神经网络模型使用不同的随机数种子进行拟合的模型。所有生成的模型都用于预测。对于回归,对每个网络的输出进行平均。对于分类,模型分数首先被平均,然后转换为预测值 类。 Source.

适合的模型数量由参数 repeats 控制,该参数通过 ...

传递给 caret 中的模型

repeats - the number of neural networks with different random number seeds。默认设置为 5。所以五个模型将被平均。在 caret's definition of the model 中,我没有看到这种变化。

如果 bag 参数设置为 TRUE 模型拟合和聚合由 bootstrap aggregation 执行,在我看来几乎可以保证提供更好的预测性能,如果型号够高了。