Skip to content

Element‐wise interaction

Alexey Taymanov edited this page Oct 12, 2023 · 1 revision

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:

  1. both namespaces are the only namespaces starting with corresponding letters (no other namespaces are added into the same feature group)
  2. first value of both vectors are equal to 1
  3. 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:

  1. both interacted namespaces a and b got excluded from final feature representation and replaced with a[0]*b[0], a[1] *b[1],...
  2. 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)
Clone this wiki locally