1) First off, yes the neural net models are run for every unique combination of .decay and .size that you've supplied in my.grid
because, well, you created it. If you just specified my.grid = data.frame('.decay'=0.5, '.size'=5)
, then you would only have one model.
As far as iterations are concerned, you specified the backend modeling application to be the nnet
function from the nnet
package, so these models are estimated using back-propagation which is an iterative gradient descent process that stops once it converges (or diverges). It could be one iteration if you specify parameters that give a local maximum in the entropy space for your algorithm initialization. Alternately, it could iterate 1000
times and and fail, since you specified maxit=1000
. This refers to the model fitting process.
Also built into this innocuous train function is a validation approach where you pick the best set of params from my.grid
according to some objective measure and resampling process. The objective measure is specified by hand or by the value of your outcome metric = ifelse(is.factor(y), "Accuracy", "RMSE")
. So depending on income
(probably continuous), you pick grid options that minimized root mean square error (minimal bias / variance trade off, a good starting place). The method of cross validation is default bootstrap with a staggering default number of resamples being 10. See ?trainControl
. Considering this is parallelized, I'm shocked. In my thesis, we weren't quite happy with 10,000
resamples.
2) Your specific model gives the combo in my.grid
for which you have minimal RMSE in the pooled 10 bootstrap resamples cross validated model outcome.
Best Answer
Not to me since there might be occasions where predictors occur with values outside of the range seen in the data.