Model Selection class

The model selection is applied to find a neural network with a topology that minimizes the error for new data. There are two ways to obtain an optimal topology: neurons selection and input selection.

Neurons selection algorithms are used to get the optimal number of neurons in the neural network’s hidden perceptron layer. Input selection algorithms are responsible for finding the optimal subset of inputs.

As we did in the previous sections, we will continue working with the iris data set, which can be downloaded from the DataSet class chapter. Before continuing, it is also advisable to read the previous chapter, TrainingStrategy class.

To construct a model selection object associated with a training strategy object, we do the following:

ModelSelection model_selection(&training_strategy);

where training_strategy is the training strategy object.

The default model selection consists of a growing inputs selection algorithm or an incremental neurons selection algorithm. The next sentence allows us to change this.

GeneticAlgorithm* genetic_algorithm = model_selection.get_genetic_algorithm_pointer();
GrowingNeurons* growing_neurons = model_selection.get_growing_neurons_pointer();
growing_neurons ->set_maximum_selection_failures(3);

The most important methods of model selection are the ones that perform the inputs and the neurons selection. Respectively, they are called as follows:


We can save the above object to a XML file."model_selection.xml");

If you need more information about ModelSelection class visit ModelSelection Class Reference.