1
$\begingroup$

I am starting to study Neural Network. I want to build a MLP where I will feed it:

  • 3 features which are continuous
  • one feature which is categorical (48 classes)

How can I do this?

Before adding the categorical feature, I was using 'relu' activation function and 'lbfgs' as a solver in MLPRegrssor in sklearn.

I was wondering: how can I integrate this variable into the network? Should I do one-hot encoding? Should I keep relu as activation function or should I try sigmoid, softmax or something like that?

$\endgroup$
  • $\begingroup$ One-hot encoding is the typical approach yes. You activation function is a hyper-parameter of the network, you can choose what works best based on your evaluation criteria. $\endgroup$ – Bar Oct 6 '17 at 14:24
1
$\begingroup$

The standard approach is to one-hot encode your categorical variable. Suppose that categorical variable has $k$ categories. You'll have $k +3$ input neurons: one for each category, and three for your continuous-valued features.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.