1
$\begingroup$

I have 3 data types that I want to feed into a neural net.

One, is a time series, which I am going to feed into the neural net directly. The second, are categorical variables that I am going to embed into vectors of equal length as the time series. The third, is quantitative numbers that I also want to embed like my categorical variables, but I do not know the best way to do this.

My initial thought is that I could input the numeric data into a vector of all 0's.

For instance, if a numeric data point is $1.32$, then:
$[1.32, 0, 0, ..., 0]$.

Or I could do something similar like: $[1.32, 1.32, 1.32, ..., 1.32]$.

Is there a common best practice for what I am trying to do?

$\endgroup$

1 Answer 1

1
$\begingroup$

Is there a common best practice for what I am trying to do?

No, there are no best practices for what you are trying to do. Your categorical variables, time series, and numeric variables don't have to be the same size. Therefore, there is no need to vectorize your single numeric input, nor should you. You just need to have that variable as its own input. If it is only one number, then so be it.

On a related note, fusing multiple data types is an exciting emerging area. This review article will give you ideas on how you can perform integration: "Fusion of medical imaging and electronic health records using deep learning: a systematic review and implementation guidelines".

$\endgroup$
2
  • $\begingroup$ So you're saying that I can take the time series data (let's say it's 5 time steps), the embedded categorical feature (let's says it's of length 3), and my numerical feature of length 1, and concatenate all of them into a single vector of length 9, and then put that final vector into the neural net? $\endgroup$
    – Mattpats
    Commented Oct 27, 2022 at 16:29
  • $\begingroup$ Hi, @Mattpats, that is very close to what I'm suggesting, but remember to one-hot encode your categorical variables. $\endgroup$ Commented Oct 27, 2022 at 22:49

You must log in to answer this question.

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