Element‐wise interaction - VowpalWabbit/vowpal_wabbit GitHub Wiki
If there are two dense vectors (namespaces) a and b of the same dimension, there is a way to learn element-wise interactions using command line --interact ab.
Required conventions:
- both namespaces are the only namespaces starting with corresponding letters (no other namespaces are added into the same feature group)
- first value of both vectors are equal to 1
- vectors are dense (integers as features names in text vw format or json array in json format) Example: '1 |a 0:1 1:0.2 2:0.3 |b 0:1 1:0.4 2:0.5'
Side effects:
- both interacted namespaces a and b got excluded from final feature representation and replaced with a[0]*b[0], a[1] *b[1],...
- interaction features are written into first(positionally) namespace hashes, so "--interact ab" and "--interact ba" are different from feature hashes point of view (but equivalent from learning perspective)