In this experiment two-layer feed-forward neural networks with different number of hidden neurons are trained on the Sonar, Mines vs. Rocks data set. The average classification error rate from 10-fold cross-validation is determined for each neural network.
The main contribution of the experiment is that it shows how to change
the value of a list type parameter of an operator (in our case, the
hidden layers parameter of the
operator) in loops using a macro.
To obtain a reasonable execution time only neural networks with the following number of hidden neurons are considered: 1, 2, 4, 8, 16.
Sonar, Mines vs. Rocks [UCI MLR]
Figure 8.5. The average classification error rate obtained from 10-fold cross-validation against the number of hidden neurons.
The figure shows that the best average classification error rate (14.5%) is achieved when the number of hidden neurons is 8.