Answers.Body: <p><strong>Is there a common best practice for what I am trying to do?</strong></p>
  <p>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.</p>
  <p>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:  <a href="https://www.nature.com/articles/s41746-020-00341-z" rel="nofollow noreferrer">&quot;Fusion of medical imaging and electronic health records using deep learning: a systematic review and implementation guidelines&quot;</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-27T16:29:34.137Z
Answers.Text: 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?
Answers.UserDisplayName: Mattpats
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-27T22:49:03.657Z
Answers.Text: Hi, @Mattpats, that is very close to what I'm suggesting, but remember to one-hot encode your categorical variables.
Answers.UserDisplayName: Snehal Patel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-25T18:53:55.653Z
Answers.LastActivityDate: 2022-10-26T00:02:05.133Z
Answers.LastEditDate: 2022-10-26T00:02:05.133Z
Answers.UserDisplayName: Snehal Patel
Body: <p>I have 3 data types that I want to feed into a neural net.</p>
  <p>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.</p>
  <p>My initial thought is that I could input the numeric data into a vector of all 0's.</p>
  <p>For instance, if a numeric data point is <span class="math-container">$1.32$</span>, then:<br />
  <span class="math-container">$[1.32, 0, 0, ..., 0]$</span>.</p>
  <p>Or I could do something similar like: <span class="math-container">$[1.32, 1.32, 1.32, ..., 1.32]$</span>.</p>
  <p>Is there a common best practice for what I am trying to do?</p>
  
Tags: <neural-networks><embeddings>
Title: How to embed quantitative variables?
UserDisplayName: Mattpats
ThreadText: # How to embed quantitative variables?
  
  (Asked by: username_0 on 2022-10-25)
  
  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?
  
  **Tags:** neural-networks, embeddings
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-10-25. Score: 1 | Accepted answer
  
  **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"](https://www.nature.com/articles/s41746-020-00341-z).
  
  > **Comments:**
  > **username_0**: 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?  
  > **username_1**: Hi, @username_0, that is very close to what I'm suggesting, but remember to one-hot encode your categorical variables.  
  
  ---
  
  