lenskit

Lenskit: what is channel, side channel, typed side channel


As the title. I do not understand the concept of channel, side channel and typed side channel in the Lenskit source code. Can anyone give me a brief explanation? Thanks.


Solution

  • LensKit lead developer here.

    Sparse vectors and scored IDs are used to associate values with IDs (usually users or items). Side channels are a mechanism to associate additional values with each ID. They are extra data (an additional 'channel' of data) that goes with the 'primary' data.

    'Typed' side channels can store any type of data (string, list, whatever). The type is associated with the key used to access the data, so you can get the data out in a type-safe fashion.

    'Unboxed' side channels (sometimes just called 'side channels', especially in older code) are an optimized implementation of side channels of Double.

    One place these are used is to allow the ItemItemScorer to report how many neighbors it used to score each item. The FallbackItemScorer uses a typed side channel to report which item scorer generated each score.

    Side channels are somewhat confusing and complicated, though. We are considering ways to change how they work for LensKit 3.0 to make it more obvious.