# Neural Network Hidden Layer Selection

I am trying to build an MLP classifier model on a dataset containing 30000 samples and 23 features. What are the standards I need to consider while selecting the number of hidden layers and number of nodes in each hidden layer?

• Try logistic regression first. Your data is small enough that logistic regression should perform well if your data is linearly separable. MLPs are generalizations of generalized linear models. If logistic regression performs poorly, you know you need to add a deeper architecture in an MLP. Start out small with a sample of your training data first. – Jon Apr 21 '18 at 15:51

1. First try a simple model: The input layer and the output layers dimension are defined by your data / your problem definition. Then train a model without any hidden layer.
2. See how good it performs. Is it good enough? If yes, you're done. If no, continue
3. Add a hidden layer of reasonable size or adjust a hidden layers size. Go to step (2).

The "reasonable" size part might be difficult. As a guidance: If you have only a single node, it is certainly too small for a 1000 class problem. It might be big enough for a 2 - 3 class problem. I would usually suggest to keep the size of the features per layer roughly constant or at most reduce it by 1/10 or triple it. But that is only gut feeling.

The reason for my preference for simple models is Occam's razor, the fact that they are often faster, easier to analyze and to manually improve.