mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r903329 - in /websites/staging/mahout/trunk/content: ./ users/recommender/recommender-documentation.html
Date Mon, 24 Mar 2014 16:23:19 GMT
Author: buildbot
Date: Mon Mar 24 16:23:19 2014
New Revision: 903329

Log:
Staging update by buildbot for mahout

Modified:
    websites/staging/mahout/trunk/content/   (props changed)
    websites/staging/mahout/trunk/content/users/recommender/recommender-documentation.html

Propchange: websites/staging/mahout/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Mar 24 16:23:19 2014
@@ -1 +1 @@
-1580534
+1580901

Modified: websites/staging/mahout/trunk/content/users/recommender/recommender-documentation.html
==============================================================================
--- websites/staging/mahout/trunk/content/users/recommender/recommender-documentation.html
(original)
+++ websites/staging/mahout/trunk/content/users/recommender/recommender-documentation.html
Mon Mar 24 16:23:19 2014
@@ -359,21 +359,22 @@ algorithm:</p>
 <p>Now we create a UserNeighborhood algorithm. Here we use nearest-3:</p>
 <div class="codehilite"><pre><span class="n">UserNeighborhood</span>
<span class="n">neighborhood</span> <span class="p">=</span>
       <span class="n">new</span> <span class="n">NearestNUserNeighborhood</span><span
class="p">(</span>3<span class="p">,</span> <span class="n">userSimilarity</span><span
class="p">,</span> <span class="n">model</span><span class="p">);{</span><span
class="n">code</span><span class="p">}</span>
+</pre></div>
+
 
-<span class="n">Now</span> <span class="n">we</span> <span class="n">can</span>
<span class="n">create</span> <span class="n">our</span> <span
class="n">Recommender</span><span class="p">,</span> <span class="n">and</span>
<span class="n">add</span> <span class="n">a</span> <span class="n">caching</span>
<span class="n">decorator</span><span class="p">:</span>
+<p>Now we can create our Recommender, and add a caching decorator:</p>
+<div class="codehilite"><pre><span class="n">Recommender</span> <span
class="n">recommender</span> <span class="p">=</span>
+  <span class="n">new</span> <span class="n">GenericUserBasedRecommender</span><span
class="p">(</span><span class="n">model</span><span class="p">,</span>
<span class="n">neighborhood</span><span class="p">,</span> <span
class="n">userSimilarity</span><span class="p">);</span>
+<span class="n">Recommender</span> <span class="n">cachingRecommender</span>
<span class="p">=</span> <span class="n">new</span> <span class="n">CachingRecommender</span><span
class="p">(</span><span class="n">recommender</span><span class="p">);</span>
 </pre></div>
 
 
-<p>Recommender recommender =
-      new GenericUserBasedRecommender(model, neighborhood,
-userSimilarity);
-Recommender cachingRecommender = new CachingRecommender(recommender);</p>
-<div class="codehilite"><pre><span class="n">Now</span> <span
class="n">we</span> <span class="n">can</span> <span class="n">get</span>
10 <span class="n">recommendations</span> <span class="k">for</span>
<span class="n">user</span> <span class="n">ID</span> &quot;1234&quot;
<span class="o">&amp;</span><span class="n">mdash</span><span
class="p">;</span> <span class="n">done</span>!
+<p>Now we can get 10 recommendations for user ID "1234" &mdash; done!</p>
+<div class="codehilite"><pre><span class="n">List</span><span
class="o">&lt;</span><span class="n">RecommendedItem</span><span
class="o">&gt;</span> <span class="n">recommendations</span> <span
class="p">=</span>
+  <span class="n">cachingRecommender</span><span class="p">.</span><span
class="n">recommend</span><span class="p">(</span>1234<span class="p">,</span>
10<span class="p">);</span>
 </pre></div>
 
 
-<p>List<RecommendedItem> recommendations =
-      cachingRecommender.recommend(1234, 10);</p>
 <h2 id="item-based-recommender">Item-based Recommender</h2>
 <p>We could have created an item-based recommender instead. Item-based
 recommender base recommendation not on user similarity, but on item



Mime
View raw message