1
$\begingroup$

Here is one row from my data:

H  7.042 5.781 5.399  -9.118   5.488  7.470

The first column is a categorical class. The rest of them are continuous numerical features.

I encoded the classes using one-hot-encoding labels and concatenated them with the numerical features list:

    1   0  1  7.042 5.781 5.399  -9.118   5.488  7.470

Then I used this list for training.

Am I achieving anything really useful here?

$\endgroup$
2
  • $\begingroup$ when you say 'features' do you refer specifically to continuous values as opposed to one hot encoded ones? $\endgroup$ Feb 24 at 8:01
  • $\begingroup$ @EdoardoGuerriero, Yes. see the edit. $\endgroup$
    – user366312
    Feb 24 at 8:41

1 Answer 1

1
$\begingroup$

Your approach is totally valid (especially considering you only have a single categorical feature).

If you're training a neural network though make sure to standardize your numerical features in order to be in the range [0, 1].

Also, in general, and again only if you're training a neural network, you might keep in mind that there's also another valid concatenation approach, happening not at the input layer level but in a hidden layer. This is common in natural language processing, where the text features can be quite larger in number than the numerical ones. By processing separately numerical and text features we can ensure that both are mapped to a fixed size dense layer, so when the concatenation occurs, we give same importance to both types of features regardless of their respective amounts. Another advantage of this approach is that when using one hot encoding the resulting features are sparse, and by keeping them separated you can treat them accordingly (for example using a loss function for sparse features only on the one hot feature block).

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .