title: Basic Pseudocode for using SVD with Movielens/Netflix type data set
body: <p>I'm struggling to figure out how exactly to begin using SVD with a MovieLens/Netflix type data set for rating predictions. I'd very much appreciate any simple samples in python/java, or basic pseudocode of the process involved. There are a number of papers/posts that summarise the overall concept but I'm not sure how to begin implementing it, even using a number of the suggested libraries.</p>
  
  <p>As far as I understand, I need to convert my initial data set as follows:</p>
  
  <p>Initial data set:</p>
  
  <pre><code>    user    movie   rating
      1       43      3
      1       57      2
      2       219     4
  </code></pre>
  
  <p>Need to pivot to be:</p>
  
  <pre><code>user        1   2
  movie   43  3   0
          57  2   0
          219 0   4
  </code></pre>
  
  <p>At this point, do I simply need to inject this Matrix into an SVD algorithm as provided by available libraries, and then (somehow) extract results, or is there more work required on my part?</p>
  
  <p>Some information I've read:</p>
  
  <p><a href="http://www.netflixprize.com/community/viewtopic.php?id=1043" rel="nofollow">http://www.netflixprize.com/community/viewtopic.php?id=1043</a> <br>
  <a href="http://sifter.org/~simon/journal/20061211.html" rel="nofollow">http://sifter.org/~simon/journal/20061211.html</a> <br>
  <a href="http://www.slideshare.net/NYCPredictiveAnalytics/building-a-recommendation-engine-an-example-of-a-product-recommendation-engine" rel="nofollow">http://www.slideshare.net/NYCPredictiveAnalytics/building-a-recommendation-engine-an-example-of-a-product-recommendation-engine</a> <br>
  <a href="http://www.slideshare.net/bmabey/svd-and-the-netflix-dataset-presentation" rel="nofollow">http://www.slideshare.net/bmabey/svd-and-the-netflix-dataset-presentation</a> <br>
  .. and a number of other papers</p>
  
  <p>Some libraries:<br>
  <a href="http://alias-i.com/lingpipe/demos/tutorial/svd/read-me.html" rel="nofollow">LingPipe(java)</a><br>
  <a href="http://math.nist.gov/javanumerics/jama/" rel="nofollow">Jama(java)</a>  <br>
  <a href="http://code.google.com/p/pyrsvd/" rel="nofollow">Pyrsvd(python)</a> <br></p>
  
  <p>Any tips at all would be appreciated, especially on a basic data set.
  Thanks very much,
  Oli</p>