# Using a onehot vector together with other data

**URL:** <https://discourse.julialang.org/t/using-a-onehot-vector-together-with-other-data/29007>\
**Category:** Machine Learning\
**Tags:** question\
**Created:** [September 20, 2019, 4:09pm UTC](https://discourse.julialang.org/t/using-a-onehot-vector-together-with-other-data/29007 "2019-09-20T16:09:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [September 20, 2019, 4:09pm UTC](https://discourse.julialang.org/t/using-a-onehot-vector-together-with-other-data/29007/1 "2019-09-20T16:09:28Z")

</div>

Is it possible to use a Flux.onehot vector together with other data as input to a Layer?

---

<div class="post-metadata">

**Author:** ![dellison](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@dellison](https://discourse.julialang.org/u/dellison)\
**Post date:** [September 20, 2019, 8:27pm UTC](https://discourse.julialang.org/t/using-a-onehot-vector-together-with-other-data/29007/2 "2019-09-20T20:27:32Z")

</div>

Can you be a little bit more specific about this? What do your data and model look like?

---

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [September 23, 2019, 8:34am UTC](https://discourse.julialang.org/t/using-a-onehot-vector-together-with-other-data/29007/3 "2019-09-23T08:34:56Z")

</div>

I have a time series that depends on some real valued variables and on the type of day (i.e. Sunday, Monday,…)  
I would like to encode the day information into a onehot vector and combine it with the rest of the variables as input.  
For know is use a for loop and convert the onehot vector for each time instance into a binary value and concatenate it with rest of the variables.  
It would be nice if `hcat` would work for such an application.
