Carolina Bento
Nov 30, 2021

--

Hi,

In this article I didn't change the number of layers, so I ended up creating a Multilayer Perceptron with a total number of 3 layers: input, hidden layer and output.

To build a Multilayer Perceptron with 5 layers I'll assume you'd like a total of 5 layers, so the overall structure is:

* layer (1) input,

* layers (2, 3, 4) hidden-layers,

* layer (5) output layer.

In this case, if each hidden layer has 2 neurons, you can assign the following tuple to the parameter hidden_layer_sizes in the MLPClassifier function:

hidden_layer_sizes = (2, 2, 2)

By setting hidden_layer_sizes = (2, 2, 2) you're saying there are three hidden layers each one with 2 neurons.

There more parameters you can adjust in the documentation https://scikit-learn.org/stable/modules/generated/sklearn.neural_network.MLPClassifier.html

--

--

Carolina Bento
Carolina Bento

Written by Carolina Bento

Articles about Data Science and Machine Learning | @carolinabento

No responses yet