0
$\begingroup$

I have a dataset of about 990,000 data with two categories. The data is highly unbalanced (about 2% in one of the categories). Every item is a 12 letter length string that can contain 4 letters (say ABCD).

I was suggested to use neural network for this data. How should I code the . strings as input? Using dummy coding like '1A', '1B', '1C', '1D' etc. and give 1 where it is true and 0 for false leading to 4x12=48 features? Or could I use a kind of categorical variable: 12 features with 4 possible values (A=1, B=2, etc.)?

Does neural networks better work with balanced datasets or could I use it with unbalanced data?

$\endgroup$
2
  • 1
    $\begingroup$ What is the source of the data? Would you expect structural "similarities" between strings/any other input you could train with word2vec? Coding words/strings into high dimensional numeric vectors is quite big field and it would be helpful to narrow down your requirements $\endgroup$ Commented Jan 12, 2018 at 9:59
  • $\begingroup$ stop treating neural nets as a magic black box, and describe how you would solve this problem (as a person). what are the actual patterns you are looking for, then one can formalise this into a statistical learning problem. eg does position matter? does aa in first two positions mean same as 'aa' at end etc. $\endgroup$
    – seanv507
    Commented Jan 14, 2018 at 12:21

1 Answer 1

1
$\begingroup$

Neural networks can't deal with categorical data as-is. You need to do one-hot encoding to use such data.

Using dummy coding like '1A', '1B', '1C', '1D' etc. and give 1 where it is true and 0 for false leading to 4x12=48 features?

Seems like a valid approach.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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