This is essentially the word2vec algorithm applied to arbitrary lists of items. Word2vec computes vectors representing words such that nearby (similar) vectors represent words that are often found in a similar context. Item2vec refers to using the exact same algorithm but applying it to arbitrary lists of items in which the order of items has a comparable interpretation to words in a sentence (the items may be categories, tags, IDs etc.).

Note, that if the order of items in the list (session/basket etc.) is not important, and you simply want item vectors to be similar if the corresponding items usually occur together in the same list, use the window parameter (see below) with a value of “all”.

We use gensim to train the item2vec model, so for further details also see it’s word2vec page.

size
integer
default: "48"

Length of resulting embedding vectors.

Values must be in the following range:

1 ≤ size < inf
sg
integer
default: "1"

Whether to use the skip-gram or CBOW algorithm. Set this to 1 for skip-gram, and 0 for CBOW.

Values must be in the following range:

0 ≤ sg ≤ 1
negative
integer
default: "20"

Update maximum for negative-sampling. Only update these many word vectors.

alpha
number
default: "0.025"

Initial learning rate.

Values must be in the following range:

0 ≤ alpha ≤ 1
window
[integer, string]
default: "5"

Size of word context window. Must be either an integer (the number of neighbouring words to consider), or any of “auto”, “max” or “all”, in which case the window is equal to the whole list/session/basket.

min_count
integer
default: "3"

Minimum count of item in dataset. If an item occurs fewer than this many times it will be ignored.

Values must be in the following range:

1 ≤ min_count < inf
iter
integer
default: "10"

Iterations. How many epochs to run the algorithm for.

Values must be in the following range:

1 ≤ iter < inf
sample
number

Percentage of most-common items to filter out (equivalent to “stop words”).

Values must be in the following range:

0 ≤ sample ≤ 1
normalize
boolean
default: "true"

Whether to return normalized item vectors.