Search code examples
machine-learningone-hot-encoding

How to add one hot vectors?


I have a few one hot vectors(more than 2) of size 48 each. How can I add them? Is there any specific method or simple arithmetic addition? If arithmetic addition then how should I handle the carry bit?

I know this may be a very basic question but I am new to the field of Artificial Intelligence and need help.


Solution

  • Well adding one hot vector isn't a usual practice. It is exclusively task centric. I was dealing with timeseries data when posted this question.

    Suppose you have three one hot vectors [0,1,0,0], [1,0,0,0] and [0,1,0,0]. The addition process that I followed was to add these vectors in bit-wise fashion i.e [0+1+0, 1+0+1, 0+0+0, 0+0+0]. The resultant vector would be [1,2,0,0].

    However, the major concern (with very large numbers of vectors) is the case when the addition produces a carry. In such a case, one may simply treat the two (or three) digit number as one i.e. [12,2,0,100].

    PS: This is a highly data-centric approach. There may exists better proposals.