# Prediction in Item-Item based collaborative filtering

I am creating an item-Based Collaborative Filtering Recommendation engine. I am trying to reduce the results of this paper: http://files.grouplens.org/papers/www10_sarwar.pdf.

I have a few questions and would greatly appreciate if someone would help me. In section 3.2.1 the predicted rating value is:

$$P_{u,i} = \dfrac{\sum_{\text{all similar items, N}}s_{i,N} * R_{u,N}}{\sum_{\text{all similar items, N}}(|s_{i,N}|)}.$$

Then in section 3.3 is says: For generating predictions for a user $u$ on item $i$, our algorithm first retrieves the precomputed $k$ most similar items corresponding to the target item $i$. Then it looks how many of those $k$ items were purchased by the user $u$, based on this intersection then the prediction is computed using basic item-based collaborative filtering algorithm.

My first question is:

1. What value is assigned to $P_{u, i}$ if the top $k$ items to item $i$ and the values for which ratings exist for user $u$ is empty?

In section 4.1 they say for the movielens data it is split for 80% training and 20% testing. The data set was converted into a user-item matrix with 943 rows and 1682 columns.

1. Do the authors split the data before converting to the user-item matrix or after?

Any help would be greatly appreciated.

1. You can choose something that's impossible to achieve otherwise, such as $P_{u,i} = -1$. Or if you have reason to believe that most of the values where there are overlapping preferences, will be reasonably far from 0, then you can set it to 0. Of course, what is reasonably far and how many, are all parts of the mysterious black-box called parameter tuning.
2. From the description in the paper, $943 \times 1682$ are the dimensions of the entire dataset, that is before they are split.