<p>My guess is that these are free parameters of the algorithm that you must set somehow.  For instance, you might evaluate different choices of these parameters on a set of training data to see which performs the best.  You could also use cross-validation or other techniques to evaluate different settings of these parameters.</p>

<p>Note that p.46 of the thesis says "This threshold value is based on the predicted ratings that are achieved after running the item-based collaborative filtering algorithm."  That sounds consistent with my interpretation above.</p>

<p>In general, I would recommend reading the original, published, peer-reviewed research papers on algorithms for this problem.  I would expect them to generally be of relatively high quality, and to be more likely to explain the algorithm and methodology in full (or cite a source that does).</p>

CC BY-SA 3.0
2013-08-06T04:29:41.373Z
If my understanding is correct and based on what you've said, it is me who will set the threshold value n and also the K value. Okay I understand that but I don't have any idea how am I going to compute those two values? Is it relative to the size of the dataset or something like that?
Harvey
CC BY-SA 3.0
2013-08-04T22:05:19.590Z
2013-08-04T22:05:19.590Z
D.W.
<p>I'm currently studying this item-based collaborative filtering algorithm on this <a href="http://www.ruor.uottawa.ca/en/handle/10393/24218" rel="nofollow">thesis</a> that I've researched and I've formulated the algorithm below based on it. I have no problem on steps 1 to 3 but in step 4 it says there: <strong>Set the threshold value n.</strong><br>
How can I determine the value of n? Is there a formula for getting the value of it? I already checked it out but there's nothing there.<br>
And also in Step 5: <strong>Select the K most similar products in M</strong>. The same question, how can I compute the value of K?</p>

<blockquote>
  <ol>
  <li>Retrieve all the item rated by an active user and put it to Q.</li>
  <li>Isolate the users who have rated both the target item (i) and the items rated by the active user in Q, get the item and put it in R.
  (co-rated items)</li>
  <li>Calculate the item similarities using the Pearson Correlation Coefficient with all the  items (j) in R.</li>
  <li>Set the threshold value n, If the similarity of i and j is greater or equal to n, (sim(i,j) >= n),  Then include it in M.</li>
  <li>Select the K most similar products in M.</li>
  <li>Take the weighted average of the users rating on these similar items K.</li>
  </ol>
</blockquote>

CC BY-SA 3.0
2013-08-04T22:02:29.173Z
Where in the thesis is that from?  Have you tried contacting the author of the thesis for clarification?
D.W.
CC BY-SA 3.0
2013-08-06T04:36:26.443Z
Actually Sir I've only formulated the algorithm based on my understanding on his thesis. And because the author didn't give his email or number, I've tried to research on the net on his name but unfortunately I can't verify if he is really the person I'm looking for.
Harvey
<ds.algorithms><machine-learning>
How to compute K and n? [Item-based Collaborative Filtering]
Harvey
# How to compute K and n? [Item-based Collaborative Filtering]

(Asked by: username_0 on 2013-08-04)

I'm currently studying this item-based collaborative filtering algorithm on this [thesis](http://www.ruor.uottawa.ca/en/handle/10393/24218) that I've researched and I've formulated the algorithm below based on it. I have no problem on steps 1 to 3 but in step 4 it says there: **Set the threshold value n.**  
How can I determine the value of n? Is there a formula for getting the value of it? I already checked it out but there's nothing there.  
And also in Step 5: **Select the K most similar products in M**. The same question, how can I compute the value of K?

> 1. Retrieve all the item rated by an active user and put it to Q.
> 2. Isolate the users who have rated both the target item (i) and the items rated by the active user in Q, get the item and put it in R.
>    (co-rated items)
> 3. Calculate the item similarities using the Pearson Correlation Coefficient with all the items (j) in R.
> 4. Set the threshold value n, If the similarity of i and j is greater or equal to n, (sim(i,j) >= n), Then include it in M.
> 5. Select the K most similar products in M.
> 6. Take the weighted average of the users rating on these similar items K.

**Tags:** ds.algorithms, machine-learning
> **Comments:**
> **username_1**: Where in the thesis is that from?  Have you tried contacting the author of the thesis for clarification?  
> **username_0**: Actually Sir I've only formulated the algorithm based on my understanding on his thesis. And because the author didn't give his email or number, I've tried to research on the net on his name but unfortunately I can't verify if he is really the person I'm looking for.  

---

## 1 answers

### Answer by username_1 on 2013-08-04. Score: 0 | Accepted answer

My guess is that these are free parameters of the algorithm that you must set somehow. For instance, you might evaluate different choices of these parameters on a set of training data to see which performs the best. You could also use cross-validation or other techniques to evaluate different settings of these parameters.

Note that p.46 of the thesis says "This threshold value is based on the predicted ratings that are achieved after running the item-based collaborative filtering algorithm." That sounds consistent with my interpretation above.

In general, I would recommend reading the original, published, peer-reviewed research papers on algorithms for this problem. I would expect them to generally be of relatively high quality, and to be more likely to explain the algorithm and methodology in full (or cite a source that does).

> **Comments:**
> **username_0**: If my understanding is correct and based on what you've said, it is me who will set the threshold value n and also the K value. Okay I understand that but I don't have any idea how am I going to compute those two values? Is it relative to the size of the dataset or something like that?  

---

