Each cell in the multi-dimensional grid points to a table, RecModel, that maintains auxiliary precomputed information to speed up the generation of the recommendation query result. The precomputed information may have different schema based on the underlying recommendation algorithm. For example, for the Item-Item collaborative filtering algorithm, RecModel represents an items similarity list with the schema (ItemID1, ItemID2, SimScore), where SimScore is computed per equation 1 (Section II).
Initialization. The multi-dimensional grid G is initialized upon issuing a CREATE RECOMMENDER statement, through two main steps: (1) Grid Construction, where we allocate the memory space for the grid, and decide on each cell size in terms of the values it represents. In case of categorical attributes (e.g., Gender, Job, and City), we allocate one cell per attribute. For continuous domain attributes (e.g., age and salary), we divide the space into N parts, where parts have almost equal number of ratings. More sophisticated techniques can be used to divide the space. Yet, we opt for a simple division here as a proof of concept for RECATHON functionality. (2) RecModel Building, where the RecModel table for each cell C in G is built by running the specified recommender algorithm in the CREATE RECOMMENDER statement on the set of users U whose attributes correspond to the subdomain covered by C. For instance, in case of ItemCosCF recommendation algorithm, we scan the ratings table and run a nested loop algorithm over all items to calculate the cosine similarity score between every item pair in each cell C using equation 1. After the initialization procedure terminates, a pointer to the newly created grid structure G is added to the RecIndex field corresponding to the appropriate recommender entry in RecCatalog.