I learn about neural networks with a heavy excercise. I have products and want to forecast the revenue. I have 10 features. But 4 features have large numbers of expressions. So my "group" features has over 500 different groups (of products). If I do binarization with the features I end up with vectors of over 1000 dimensions as input. All the product classes are names with letters and numbers such as "100XA9". Now there are 500 of those. For a neural network I have to do binarization with those names. Is that right? Then my input layer is 1000, right?

My question is this "normal"? And is this problematic for computation?

I mean this is a typical question. A store with many products (like over 500) will forecast its revenue based on the prices and other features.

I hope you can help me to untestand how to use neural networks for classification.

  • $\begingroup$ How many data samples do you have? Is there one sample per product, one sample per sale, or some other structure to your data? $\endgroup$ May 8 '17 at 20:20
  • $\begingroup$ GIven a product you want to be able to forecast its revenue? I do not see how this would be possible simply given a product name. If I have a product AGATSR which sells very well, what information will that contain about product GYTSR. Usually with a NN you would extract information (feature selection) about the product and feed that through the network in order to teach the network what kinds of products result in what revenue levels. $\endgroup$
    – JahKnows
    May 9 '17 at 11:56
  • $\begingroup$ If you expand on your problem definition I would gladly give some recommendations as to how you can structure your problem. $\endgroup$
    – JahKnows
    May 9 '17 at 11:57

One-hot encoding is the normal approach, and yes you would end up with 500 features for your group alone. Depending on how much training data you have this does not need to be a problem. If you have a lot of other features without direct interactions between the individual products you could use an Embedding layer before adding them to the rest, which maps your sparse categorical one-hot encoded features into a dense space via backpropagation. This will reduce the amount of parameters significantly.

If you don't have enough training data to do this, you could look at gathering statistics about your product, that say something about other features for the group, or about the target for other rows (be sure not to use the current row, which would introduce target leakage) which would allow you to drop the category all together.

Turning them into IDs and then using this as a numerical feature is a bad idea, since there is no inherent structure in the numbers, which means there is no signal in that and it would need a very high complexity to learn how to distinguish 1 and 5 being very similar but 2 and 4 very different.


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.