title: Building a User Based Collaborative Filtering Recommendation System in R
body: <p>I have a matrix with 129539 rows and 530 columns. The first column correspond to ClientIDs and the first row to product brands. Inside I have a ranking index that each ClientID has for every product brand (0 if the ClientID never bought the product, all the way up to 10 otherwise).</p>
  
  <p>I am building a User Based Collaborative Filtering Recommender System in R, using the first 5000 rows for training, and it gives me an output that doesn't make sense to me.</p>
  
  <p>The code I have to generate it is the following:</p>
  
  <p><code># Loading to pre-computed affinity data</code><br>
  <code>affinity.data &lt;-read.csv("mydirectory")</code><br>
  <code>affinity.matrix &lt;- as(affinity.data,"realRatingMatrix")</code></p>
  
  <p><code># Creation of the model - U(ser) B(ased) C(ollaborative) F(iltering)</code><br>
  <code>Rec.model &lt;- Recommender(Rank_dataframe[1:5000,],method="UBCF", param=list(normalize = "Z-score",method="Cosine",nn=5, minRating=0))</code></p>
  
  <p><code># recommended top 5 items for user 1507323</code><br>
  <code>recommended.items.1507323 &lt;- predict(Rec.model, affinity.matrix["1507323",], n=5)</code>
  <code># to display them</code><br>
  <code>as(recommended.items.1507323, "list")</code></p>
  
  <p>The output I'm getting is a list of values such as:<br>
  <code>[[1]]
  [1] "0.0061652281134402"  "0.00661813368630046" "0.0119331742243437"  "0.0136147038801906" 
  [5] "0.0138312586445367"</code></p>
  
  <p>I was expecting the names of the brands that I am trying to recommend, not a list of numbers.
  PS: my original matrix has values from 0 to 10 (decimals included, not only integers)</p>
  
  <p>Thank you very much for any help or clarification you may have.</p>