http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/productranking/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/productranking/quickstart/index.html 
b/templates/productranking/quickstart/index.html
index 666aa7f..0563720 100644
--- a/templates/productranking/quickstart/index.html
+++ b/templates/productranking/quickstart/index.html
@@ -32,7 +32,7 @@ Your system is all ready to go.
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span>               MyApp1 |    1 | 
3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F | <span 
class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span>               MyApp2 |    2 | 
io5lz6Eg4m3Xe4JZTBFE13GMAf1dhFl6ZteuJfrO84XpdOz9wRCrDU44EUaYuXq5 | <span 
class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span> Finished listing 2 app<span class="o">(</span>s<span 
class="o">)</span>.
-</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 
id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, 
let&#39;s collect some training data for the app of this Engine. By default, 
the Product Ranking Engine Template supports 2 types of entities: 
<strong>user</strong> and <strong>item</strong>, and event 
<strong>view</strong>. A user can view an item. This template requires 
&#39;$set&#39; user event, &#39;$set&#39; item event and user-view-item 
events.</p><p>You can send these events to PredictionIO Event Server in 
real-time easily by making a HTTP request or through the provided SDK. Please 
see <a href="/appintegration/">App Integration Overview</a> for more details 
how to integrate your app with SDK.</p><p>Let&#39;s try sending events to 
EventServer with the following <code>curl</code> commands (The corresponding 
SDK code is showed in other tabs).</p><p>Replace 
<code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in above steps. N
 ote that <code>localhost:7070</code> is the default URL of the Event 
Server.</p><p>For convenience, set your access key to the shell variable, 
run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a 
href="#"></a></p> <p>For example, when a new user with id &quot;u0&quot; is 
created in your app on time <code>2014-11-02T09:39:45.618-08:00</code> (current 
time will be used if eventTime is not specified), you can send a 
<code>$set</code> event for this user. To send this event, run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-33c6048e-5bea-42ec-8d1a-efd112c635ea">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-e6ba6392-9095-4d3a-a5ed-8be809313ebf">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-3f007bbc-36a2-4257-9683-72c563739618">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-bf0bd7d9-09e6-4e63-a751-81f91eb502f1">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-3fb6fa1c-d968-41be-
 91da-cab6fea98a81">Java SDK</a></li> </ul> <div data-tab="REST API" 
data-lang="json" id="tab-33c6048e-5bea-42ec-8d1a-efd112c635ea"> <div 
class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 
id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, 
let&#39;s collect some training data for the app of this Engine. By default, 
the Product Ranking Engine Template supports 2 types of entities: 
<strong>user</strong> and <strong>item</strong>, and event 
<strong>view</strong>. A user can view an item. This template requires 
&#39;$set&#39; user event, &#39;$set&#39; item event and user-view-item 
events.</p><p>You can send these events to PredictionIO Event Server in 
real-time easily by making a HTTP request or through the provided SDK. Please 
see <a href="/appintegration/">App Integration Overview</a> for more details 
how to integrate your app with SDK.</p><p>Let&#39;s try sending events to 
EventServer with the following <code>curl</code> commands (The corresponding 
SDK code is showed in other tabs).</p><p>Replace 
<code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in above steps. N
 ote that <code>localhost:7070</code> is the default URL of the Event 
Server.</p><p>For convenience, set your access key to the shell variable, 
run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a 
href="#"></a></p> <p>For example, when a new user with id &quot;u0&quot; is 
created in your app on time <code>2014-11-02T09:39:45.618-08:00</code> (current 
time will be used if eventTime is not specified), you can send a 
<code>$set</code> event for this user. To send this event, run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-ba9d4544-a085-4d23-a04c-5eab21c84b59">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-d8a5f5f5-df65-40fb-bbbc-db1500d570b3">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-fdd09a7b-69e5-4530-bd24-3ed77cb67286">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-f7c19bde-2ab3-43ea-abda-58c06d2f53bd">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-2282f1a6-c23f-41f0-
 a2b4-bfcc20819c27">Java SDK</a></li> </ul> <div data-tab="REST API" 
data-lang="json" id="tab-ba9d4544-a085-4d23-a04c-5eab21c84b59"> <div 
class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -47,7 +47,7 @@ Your system is all ready to go.
   "entityId" : "u0",
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-e6ba6392-9095-4d3a-a5ed-8be809313ebf"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-d8a5f5f5-df65-40fb-bbbc-db1500d570b3"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -78,7 +78,7 @@ Your system is all ready to go.
   <span class="n">entity_type</span><span class="o">=</span><span 
class="s">"user"</span><span class="p">,</span>
   <span class="n">entity_id</span><span class="o">=&lt;</span><span 
class="n">USER_ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-3f007bbc-36a2-4257-9683-72c563739618"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-fdd09a7b-69e5-4530-bd24-3ed77cb67286"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -103,7 +103,7 @@ Your system is all ready to go.
   <span class="s1">'entityId'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="nx">USER</span> <span 
class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-bf0bd7d9-09e6-4e63-a751-81f91eb502f1"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-f7c19bde-2ab3-43ea-abda-58c06d2f53bd"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -120,7 +120,7 @@ Your system is all ready to go.
   <span class="s1">'user'</span><span class="p">,</span>
   <span class="o">&lt;</span><span class="no">USER</span> <span 
class="no">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-3fb6fa1c-d968-41be-91da-cab6fea98a81"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-2282f1a6-c23f-41f0-a2b4-bfcc20819c27"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -145,7 +145,7 @@ Your system is all ready to go.
   <span class="o">.</span><span class="na">entityType</span><span 
class="o">(</span><span class="s">"user"</span><span class="o">)</span>
   <span class="o">.</span><span class="na">entityId</span><span 
class="o">(&lt;</span><span class="n">USER_ID</span><span 
class="o">&gt;);</span>
 <span class="n">client</span><span class="o">.</span><span 
class="na">createEvent</span><span class="o">(</span><span 
class="n">userEvent</span><span class="o">);</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a new item 
&quot;i0&quot; is created in your app on time 
<code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if 
eventTime is not specified), you can send a <code>$set</code> event for the 
item. Run the following <code>curl</code> command:</p><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-42cfe9ec-9de0-4cc4-80a1-0b690a96dc8c">REST API</a></li> <li 
data-lang="python"><a href="#tab-3dc2ef97-95ab-4808-9af1-b4011ed4e597">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-f30ea138-7d6c-4662-944b-68a780ca807e">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-31dfbcfc-f52b-4c03-928a-11d94c6c9079">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-15bfa33e-101e-4677-b06e-790abb9c4cc6">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-42cfe9ec-9de0-4cc4-80a1-0b690a96dc8c"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td cla
 ss="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a new item 
&quot;i0&quot; is created in your app on time 
<code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if 
eventTime is not specified), you can send a <code>$set</code> event for the 
item. Run the following <code>curl</code> command:</p><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-26272cc6-a422-4e59-aa9b-9de50c6c36bb">REST API</a></li> <li 
data-lang="python"><a href="#tab-decb2396-db3e-4a54-8383-78f167420dad">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-dc263d6b-83e5-4e22-8c8e-f7f6b48fc01c">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-f7ccb7b9-6e59-4382-a4ec-17432854a5ff">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-42bf0ede-2051-4e13-a2e2-7b2b1c63af23">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-26272cc6-a422-4e59-aa9b-9de50c6c36bb"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td cla
 ss="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -160,7 +160,7 @@ Your system is all ready to go.
   "entityId" : "i0",
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-3dc2ef97-95ab-4808-9af1-b4011ed4e597"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-decb2396-db3e-4a54-8383-78f167420dad"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -173,7 +173,7 @@ Your system is all ready to go.
   <span class="n">entity_type</span><span class="o">=</span><span 
class="s">"item"</span><span class="p">,</span>
   <span class="n">entity_id</span><span class="o">=&lt;</span><span 
class="n">ITEM_ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-f30ea138-7d6c-4662-944b-68a780ca807e"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-dc263d6b-83e5-4e22-8c8e-f7f6b48fc01c"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -190,7 +190,7 @@ Your system is all ready to go.
 <span class="p">));</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-31dfbcfc-f52b-4c03-928a-11d94c6c9079"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-f7ccb7b9-6e59-4382-a4ec-17432854a5ff"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -203,7 +203,7 @@ Your system is all ready to go.
   <span class="o">&lt;</span><span class="no">ITEM</span> <span 
class="no">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-15bfa33e-101e-4677-b06e-790abb9c4cc6"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-42bf0ede-2051-4e13-a2e2-7b2b1c63af23"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -214,7 +214,7 @@ Your system is all ready to go.
   <span class="o">.</span><span class="na">entityType</span><span 
class="o">(</span><span class="s">"item"</span><span class="o">)</span>
   <span class="o">.</span><span class="na">entityId</span><span 
class="o">(&lt;</span><span class="n">ITEM_ID</span><span 
class="o">&gt;);</span>
 <span class="n">client</span><span class="o">.</span><span 
class="na">createEvent</span><span class="o">(</span><span 
class="n">itemEvent</span><span class="o">)</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When the user 
&quot;u0&quot; view item &quot;i0&quot; on time 
<code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if 
eventTime is not specified), you can send a view event. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-6e4049bc-d55f-46a9-8de0-ed9adc85a850">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-3f1a1f75-f51f-439d-91d3-0fad76d2dfa9">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-9527334d-4c9d-4427-9752-7c07bd8f6120">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-6bf794a6-5ef0-4f6c-a9ed-421678e2fbf1">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-82a59f43-2c33-4c87-86c3-2732e0a4b63a">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-6e4049bc-d55f-46a9-8de0-ed9adc85a850"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text
 -align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <p>When the user 
&quot;u0&quot; view item &quot;i0&quot; on time 
<code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if 
eventTime is not specified), you can send a view event. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-452ee43a-8cd6-42aa-adfa-724d6b61189e">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-957daa91-837a-49a0-a448-8bb73ca0b674">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-b39ae3b1-87cf-4f30-97c5-78a6c6b95c6b">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-ebcbb759-0ae6-483a-8489-63bd1592e074">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-e8c3ceca-bed7-4bd7-b247-542c555cbe2a">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-452ee43a-8cd6-42aa-adfa-724d6b61189e"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text
 -align: right"><pre class="lineno">1
 2
 3
 4
@@ -233,7 +233,7 @@ Your system is all ready to go.
   "targetEntityId" : "i0",
   "eventTime" : "2014-11-10T12:34:56.123-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-3f1a1f75-f51f-439d-91d3-0fad76d2dfa9"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-957daa91-837a-49a0-a448-8bb73ca0b674"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -250,7 +250,7 @@ Your system is all ready to go.
   <span class="n">target_entity_type</span><span class="o">=</span><span 
class="s">"item"</span><span class="p">,</span>
   <span class="n">target_entity_id</span><span class="o">=&lt;</span><span 
class="n">ITEM</span> <span class="n">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-9527334d-4c9d-4427-9752-7c07bd8f6120"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-b39ae3b1-87cf-4f30-97c5-78a6c6b95c6b"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -269,7 +269,7 @@ Your system is all ready to go.
    <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="nx">ITEM</span> <span 
class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-6bf794a6-5ef0-4f6c-a9ed-421678e2fbf1"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-ebcbb759-0ae6-483a-8489-63bd1592e074"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -286,7 +286,7 @@ Your system is all ready to go.
     <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> 
<span class="o">&lt;</span><span class="no">ITEM</span> <span 
class="no">ID</span><span class="o">&gt;</span>
   <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-82a59f43-2c33-4c87-86c3-2732e0a4b63a"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-e8c3ceca-bed7-4bd7-b247-542c555cbe2a"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -344,14 +344,14 @@ User u10 views item i7
 </pre></td></tr></tbody></table> </div> <p>When the engine is deployed 
successfully and running, you should see a console message similar to the 
following:</p><div class="highlight shell"><table style="border-spacing: 
0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre 
class="lineno">1
 2</pre></td><td class="code"><pre><span class="o">[</span>INFO] <span 
class="o">[</span>HttpListener] Bound to /0.0.0.0:8000
 <span class="o">[</span>INFO] <span class="o">[</span>MasterActor] Bind 
successful. Ready to serve.
-</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine 
process.</p><p>By default, the deployed engine binds to <a 
href="http://localhost:8000";><a 
href="http://localhost:8000";>http://localhost:8000</a></a>. You can visit that 
page in your web browser to check its status.</p><p><img alt="Engine Status" 
src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' 
class='header-anchors'>6. Use the Engine</h2><p>Now, You can retrieve predicted 
results. To rank items with IDs &quot;i1&quot;, &quot;i3&quot;, 
&quot;i10&quot;, &quot;i2&quot;, &quot;i5&quot;, &quot;i31&quot;, 
&quot;i9&quot; for user &quot;u2&quot;. You send this JSON <code>{ 
&quot;user&quot;: &quot;u2&quot;, &quot;items&quot;: [&quot;i1&quot;, 
&quot;i3&quot;, &quot;i10&quot;, &quot;i2&quot;, &quot;i5&quot;, 
&quot;i31&quot;, &quot;i9&quot;] }</code> to the deployed engine and it will 
return a JSON of the ranked items. Simply send a query by making a HTTP request 
or through the <code>EngineCl
 ient</code> of an SDK.</p><p>With the deployed engine running, open another 
temrinal and run the following <code>curl</code> command or use SDK to send the 
query:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a 
href="#tab-1e074765-adbc-43a2-b95d-a9651b87bed0">REST API</a></li> <li 
data-lang="python"><a href="#tab-507a7c09-7c8e-44d8-8c14-6a221a8eba6f">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-ac1d6e79-36c9-411d-8b72-de055b247fd7">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-68a48e25-bbec-4f9c-a6cc-d10c366d32cb">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-22b342ab-b6f8-4785-8550-5568e71613cb">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-1e074765-adbc-43a2-b95d-a9651b87bed0"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine 
process.</p><p>By default, the deployed engine binds to <a 
href="http://localhost:8000";><a 
href="http://localhost:8000";>http://localhost:8000</a></a>. You can visit that 
page in your web browser to check its status.</p><p><img alt="Engine Status" 
src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' 
class='header-anchors'>6. Use the Engine</h2><p>Now, You can retrieve predicted 
results. To rank items with IDs &quot;i1&quot;, &quot;i3&quot;, 
&quot;i10&quot;, &quot;i2&quot;, &quot;i5&quot;, &quot;i31&quot;, 
&quot;i9&quot; for user &quot;u2&quot;. You send this JSON <code>{ 
&quot;user&quot;: &quot;u2&quot;, &quot;items&quot;: [&quot;i1&quot;, 
&quot;i3&quot;, &quot;i10&quot;, &quot;i2&quot;, &quot;i5&quot;, 
&quot;i31&quot;, &quot;i9&quot;] }</code> to the deployed engine and it will 
return a JSON of the ranked items. Simply send a query by making a HTTP request 
or through the <code>EngineCl
 ient</code> of an SDK.</p><p>With the deployed engine running, open another 
temrinal and run the following <code>curl</code> command or use SDK to send the 
query:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a 
href="#tab-9eb595b7-19f2-4c7b-8bdf-d2ad1d377bc6">REST API</a></li> <li 
data-lang="python"><a href="#tab-33d1c418-061c-45d1-a513-80c1b8c70a24">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-690ea1c4-f87a-410a-a891-ca43d9b1a8f1">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-075602cf-bc3e-44d1-8c62-f0f4f0baf10a">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-0be879f7-e9be-406d-a27b-0690dcb4896f">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-9eb595b7-19f2-4c7b-8bdf-d2ad1d377bc6"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
 2
 3
 4</pre></td> <td class="code"><pre><span class="gp">$ </span>curl -H <span 
class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
 -d <span class="s1">'{ "user": "u2", "items": ["i1", "i3", "i10", "i2", "i5", 
"i31", "i9"]}'</span> <span class="se">\</span>
 http://localhost:8000/queries.json
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-507a7c09-7c8e-44d8-8c14-6a221a8eba6f"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-33d1c418-061c-45d1-a513-80c1b8c70a24"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -362,7 +362,7 @@ http://localhost:8000/queries.json
   <span class="s">"user"</span><span class="p">:</span> <span 
class="s">"u2"</span><span class="p">,</span>
   <span class="s">"items"</span><span class="p">:</span> <span 
class="p">[</span><span class="s">"i1"</span><span class="p">,</span> <span 
class="s">"i3"</span><span class="p">,</span> <span class="s">"i10"</span><span 
class="p">,</span> <span class="s">"i2"</span><span class="p">,</span> <span 
class="s">"i5"</span><span class="p">,</span> <span class="s">"i31"</span><span 
class="p">,</span> <span class="s">"i9"</span><span class="p">]</span>
 <span class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-ac1d6e79-36c9-411d-8b72-de055b247fd7"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-690ea1c4-f87a-410a-a891-ca43d9b1a8f1"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -385,7 +385,7 @@ http://localhost:8000/queries.json
 <span class="nb">print_r</span><span class="p">(</span><span 
class="nv">$response</span><span class="p">);</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-68a48e25-bbec-4f9c-a6cc-d10c366d32cb"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-075602cf-bc3e-44d1-8c62-f0f4f0baf10a"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -402,7 +402,7 @@ http://localhost:8000/queries.json
   <span class="s1">'items'</span> <span class="o">=&gt;</span> <span 
class="p">[</span><span class="s1">'i1'</span><span class="p">,</span> <span 
class="s1">'i3'</span><span class="p">,</span> <span 
class="s1">'i10'</span><span class="p">,</span> <span 
class="s1">'i2'</span><span class="p">,</span> <span 
class="s1">'i5'</span><span class="p">,</span> <span 
class="s1">'i31'</span><span class="p">,</span> <span 
class="s1">'i9'</span><span class="p">])</span>
 
 <span class="nb">puts</span> <span class="n">response</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-22b342ab-b6f8-4785-8550-5568e71613cb"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-0be879f7-e9be-406d-a27b-0690dcb4896f"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/productranking/quickstart/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/productranking/quickstart/index.html.gz 
b/templates/productranking/quickstart/index.html.gz
index 3187ece..3f1d954 100644
Binary files a/templates/productranking/quickstart/index.html.gz and 
b/templates/productranking/quickstart/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/recommendation/batch-evaluator/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/batch-evaluator/index.html.gz 
b/templates/recommendation/batch-evaluator/index.html.gz
index d7833d3..00790d3 100644
Binary files a/templates/recommendation/batch-evaluator/index.html.gz and 
b/templates/recommendation/batch-evaluator/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/recommendation/blacklist-items/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/blacklist-items/index.html.gz 
b/templates/recommendation/blacklist-items/index.html.gz
index a0597db..d48a348 100644
Binary files a/templates/recommendation/blacklist-items/index.html.gz and 
b/templates/recommendation/blacklist-items/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/recommendation/customize-data-prep/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/customize-data-prep/index.html.gz 
b/templates/recommendation/customize-data-prep/index.html.gz
index 3dac555..8dcefc0 100644
Binary files a/templates/recommendation/customize-data-prep/index.html.gz and 
b/templates/recommendation/customize-data-prep/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/recommendation/customize-serving/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/customize-serving/index.html.gz 
b/templates/recommendation/customize-serving/index.html.gz
index eee8d1f..235967b 100644
Binary files a/templates/recommendation/customize-serving/index.html.gz and 
b/templates/recommendation/customize-serving/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/recommendation/dase/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/dase/index.html.gz 
b/templates/recommendation/dase/index.html.gz
index 74bfa12..a4ccb2e 100644
Binary files a/templates/recommendation/dase/index.html.gz and 
b/templates/recommendation/dase/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/recommendation/evaluation/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/evaluation/index.html.gz 
b/templates/recommendation/evaluation/index.html.gz
index c5aa6bd..87c29f8 100644
Binary files a/templates/recommendation/evaluation/index.html.gz and 
b/templates/recommendation/evaluation/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/recommendation/how-to/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/how-to/index.html.gz 
b/templates/recommendation/how-to/index.html.gz
index c335942..a165abe 100644
Binary files a/templates/recommendation/how-to/index.html.gz and 
b/templates/recommendation/how-to/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/recommendation/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/recommendation/quickstart/index.html 
b/templates/recommendation/quickstart/index.html
index 2e42692..f9fab15 100644
--- a/templates/recommendation/quickstart/index.html
+++ b/templates/recommendation/quickstart/index.html
@@ -32,7 +32,7 @@ Your system is all ready to go.
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span>               MyApp1 |    1 | 
3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F | <span 
class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span>               MyApp2 |    2 | 
io5lz6Eg4m3Xe4JZTBFE13GMAf1dhFl6ZteuJfrO84XpdOz9wRCrDU44EUaYuXq5 | <span 
class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span> Finished listing 2 app<span class="o">(</span>s<span 
class="o">)</span>.
-</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 
id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, 
let&#39;s collect some training data. By default, the Recommendation Engine 
Template supports 2 types of events: <strong>rate</strong> and 
<strong>buy</strong>. A user can give a rating score to an item or he can buy 
an item. This template requires user-view-item and user-buy-item 
events.</p><div class="alert-message info"><p>This template can easily be 
customized to consider more user events such as <em>like</em>, <em>dislike</em> 
etc.</p></div><p>You can send these events to PredictionIO Event Server in 
real-time easily by making a HTTP request or through the provided SDK. Please 
see <a href="/appintegration/">App Integration Overview</a> for more details 
how to integrate your app with SDK.</p><p>Let&#39;s try sending events to 
EventServer with the following <code>curl</code> commands (The corresponding 
SDK code is showed in other tabs)
 .</p><p>Replace <code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated 
in above steps. Note that <code>localhost:7070</code> is the default URL of the 
Event Server.</p><p>For convenience, set your access key to the shell variable, 
run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a 
href="#"></a></p> <p>For example, when a user with ID &quot;u0&quot; rate an 
item with ID &quot;i0&quot; with rating of 5 on time 
<code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if 
eventTime is not specified), you can send the following &quot;rate&quot; event. 
Run the following <code>curl</code> command:</p><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-f7932003-d5b5-430f-a552-c21bc0de0ade">REST API</a></li> <li 
data-lang="python"><a href="#tab-b941d9d7-3775-42a7-8056-b9cc96940b2c">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-ff9f38ab-4440-4c6b-bf70-dd9db5b5fc34">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-8d43d39a-d754
 -4a6d-bf52-3b3d369bce07">Ruby SDK</a></li> <li data-lang="java"><a 
href="#tab-f9e62e5b-ba5c-4778-82c1-870634dd7b54">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-f7932003-d5b5-430f-a552-c21bc0de0ade"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 
id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, 
let&#39;s collect some training data. By default, the Recommendation Engine 
Template supports 2 types of events: <strong>rate</strong> and 
<strong>buy</strong>. A user can give a rating score to an item or he can buy 
an item. This template requires user-view-item and user-buy-item 
events.</p><div class="alert-message info"><p>This template can easily be 
customized to consider more user events such as <em>like</em>, <em>dislike</em> 
etc.</p></div><p>You can send these events to PredictionIO Event Server in 
real-time easily by making a HTTP request or through the provided SDK. Please 
see <a href="/appintegration/">App Integration Overview</a> for more details 
how to integrate your app with SDK.</p><p>Let&#39;s try sending events to 
EventServer with the following <code>curl</code> commands (The corresponding 
SDK code is showed in other tabs)
 .</p><p>Replace <code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated 
in above steps. Note that <code>localhost:7070</code> is the default URL of the 
Event Server.</p><p>For convenience, set your access key to the shell variable, 
run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a 
href="#"></a></p> <p>For example, when a user with ID &quot;u0&quot; rate an 
item with ID &quot;i0&quot; with rating of 5 on time 
<code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if 
eventTime is not specified), you can send the following &quot;rate&quot; event. 
Run the following <code>curl</code> command:</p><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-836a4cf5-03e3-4254-bf3f-f839beeb6324">REST API</a></li> <li 
data-lang="python"><a href="#tab-3ae0c923-3b4e-435e-9d67-4055bd1ac9d4">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-93ae2ec8-95c1-4b1c-b749-a7aa6738efb6">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-718ccea3-2a8f
 -489d-9ff0-fd3bcb706801">Ruby SDK</a></li> <li data-lang="java"><a 
href="#tab-8e47e536-ed5b-4232-8b61-072fa28383d4">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-836a4cf5-03e3-4254-bf3f-f839beeb6324"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -57,7 +57,7 @@ Your system is all ready to go.
   }
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-b941d9d7-3775-42a7-8056-b9cc96940b2c"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-3ae0c923-3b4e-435e-9d67-4055bd1ac9d4"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -92,7 +92,7 @@ Your system is all ready to go.
     <span class="n">target_entity_id</span><span class="o">=&lt;</span><span 
class="n">ITEM</span> <span class="n">ID</span><span class="o">&gt;</span><span 
class="p">,</span>
     <span class="n">properties</span><span class="o">=</span> <span 
class="p">{</span> <span class="s">"rating"</span> <span class="p">:</span> 
<span class="nb">float</span><span class="p">(</span><span 
class="o">&lt;</span><span class="n">RATING</span><span 
class="o">&gt;</span><span class="p">)</span> <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-ff9f38ab-4440-4c6b-bf70-dd9db5b5fc34"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-93ae2ec8-95c1-4b1c-b749-a7aa6738efb6"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -123,7 +123,7 @@ Your system is all ready to go.
    <span class="s1">'properties'</span> <span class="o">=&gt;</span> <span 
class="k">array</span><span class="p">(</span><span 
class="s1">'rating'</span><span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="nx">RATING</span><span 
class="o">&gt;</span><span class="p">)</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-8d43d39a-d754-4a6d-bf52-3b3d369bce07"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-718ccea3-2a8f-489d-9ff0-fd3bcb706801"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -150,7 +150,7 @@ Your system is all ready to go.
   <span class="p">}</span>
 <span class="p">)</span>
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-f9e62e5b-ba5c-4778-82c1-870634dd7b54"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-8e47e536-ed5b-4232-8b61-072fa28383d4"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -179,7 +179,7 @@ Your system is all ready to go.
     <span class="o">.</span><span class="na">property</span><span 
class="o">(</span><span class="s">"rating"</span><span class="o">,</span> <span 
class="k">new</span> <span class="n">Float</span><span 
class="o">(&lt;</span><span class="n">RATING</span><span 
class="o">&gt;));</span>
 <span class="n">client</span><span class="o">.</span><span 
class="na">createEvent</span><span class="o">(</span><span 
class="n">rateEvent</span><span class="o">);</span>
 
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a user with ID 
&quot;u1&quot; buy an item with ID &quot;i2&quot; on time 
<code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if 
eventTime is not specified), you can send the following &quot;rate&quot; event. 
Run the following <code>curl</code> command:</p><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-b76d1c3e-78ed-4ca1-8867-418e339f136f">REST API</a></li> <li 
data-lang="python"><a href="#tab-5071cfcf-37fd-44c1-8be0-c8c17477a9da">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-bc91b47f-0d3a-45f4-9779-c952e8288bd3">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-490d35cf-ac93-470e-8b93-524b2190e3a3">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-28c2db94-f04a-40d7-8517-df2562d66762">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-b76d1c3e-78ed-4ca1-8867-418e339f136f"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbod
 y><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a user with ID 
&quot;u1&quot; buy an item with ID &quot;i2&quot; on time 
<code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if 
eventTime is not specified), you can send the following &quot;rate&quot; event. 
Run the following <code>curl</code> command:</p><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-2a16e3c1-fe40-476d-ac94-86b262fa05b2">REST API</a></li> <li 
data-lang="python"><a href="#tab-8692a6de-ddb9-4fd6-91a6-4675b1296fb9">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-60f72d6b-32dd-4b30-9cc9-d6ff9dc1b740">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-276588bc-7f3a-42bb-a10e-a93b829d62a9">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-070096ae-b172-41f2-a8f6-78db06dc378b">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-2a16e3c1-fe40-476d-ac94-86b262fa05b2"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbod
 y><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -198,7 +198,7 @@ Your system is all ready to go.
   "targetEntityId" : "i2",
   "eventTime" : "2014-11-10T12:34:56.123-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-5071cfcf-37fd-44c1-8be0-c8c17477a9da"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-8692a6de-ddb9-4fd6-91a6-4675b1296fb9"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -213,7 +213,7 @@ Your system is all ready to go.
     <span class="n">target_entity_type</span><span class="o">=</span><span 
class="s">"item"</span><span class="p">,</span>
     <span class="n">target_entity_id</span><span class="o">=&lt;</span><span 
class="n">ITEM</span> <span class="n">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-bc91b47f-0d3a-45f4-9779-c952e8288bd3"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-60f72d6b-32dd-4b30-9cc9-d6ff9dc1b740"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -232,7 +232,7 @@ Your system is all ready to go.
    <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="nx">ITEM</span> <span 
class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-490d35cf-ac93-470e-8b93-524b2190e3a3"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-276588bc-7f3a-42bb-a10e-a93b829d62a9"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -249,7 +249,7 @@ Your system is all ready to go.
     <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> 
<span class="o">&lt;</span><span class="no">ITEM</span> <span 
class="no">ID</span><span class="o">&gt;</span>
   <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-28c2db94-f04a-40d7-8517-df2562d66762"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-070096ae-b172-41f2-a8f6-78db06dc378b"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -297,17 +297,17 @@ Your system is all ready to go.
 </pre></td></tr></tbody></table> </div> <p>When the engine is deployed 
successfully and running, you should see a console message similar to the 
following:</p><div class="highlight shell"><table style="border-spacing: 
0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre 
class="lineno">1
 2</pre></td><td class="code"><pre><span class="o">[</span>INFO] <span 
class="o">[</span>HttpListener] Bound to /0.0.0.0:8000
 <span class="o">[</span>INFO] <span class="o">[</span>MasterActor] Bind 
successful. Ready to serve.
-</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine 
process.</p><p>By default, the deployed engine binds to <a 
href="http://localhost:8000";><a 
href="http://localhost:8000";>http://localhost:8000</a></a>. You can visit that 
page in your web browser to check its status.</p><p><img alt="Engine Status" 
src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' 
class='header-anchors'>6. Use the Engine</h2><p>Now, You can try to retrieve 
predicted results. To recommend 4 movies to user whose id is 1, you send this 
JSON <code>{ &quot;user&quot;: &quot;1&quot;, &quot;num&quot;: 4 }</code> to 
the deployed engine and it will return a JSON of the recommended movies. Simply 
send a query by making a HTTP request or through the <code>EngineClient</code> 
of an SDK.</p><p>With the deployed engine running, open another temrinal and 
run the following <code>curl</code> command or use SDK to send the 
query:</p><div class="tabs"> <ul class="control"> <li data-lang
 ="json"><a href="#tab-e1d852a3-d6e8-497a-bb0c-6b30d9d3ca9b">REST API</a></li> 
<li data-lang="python"><a 
href="#tab-439706eb-c53c-416c-915d-708db9a6b9bf">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-81db23b7-4402-4955-a228-04126fd37c7e">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-e6bfef5d-5d8a-4d3f-9e7b-340d5391fdc0">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-5db3542e-1def-490e-be3a-da33967afd7f">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-e1d852a3-d6e8-497a-bb0c-6b30d9d3ca9b"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine 
process.</p><p>By default, the deployed engine binds to <a 
href="http://localhost:8000";><a 
href="http://localhost:8000";>http://localhost:8000</a></a>. You can visit that 
page in your web browser to check its status.</p><p><img alt="Engine Status" 
src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' 
class='header-anchors'>6. Use the Engine</h2><p>Now, You can try to retrieve 
predicted results. To recommend 4 movies to user whose id is 1, you send this 
JSON <code>{ &quot;user&quot;: &quot;1&quot;, &quot;num&quot;: 4 }</code> to 
the deployed engine and it will return a JSON of the recommended movies. Simply 
send a query by making a HTTP request or through the <code>EngineClient</code> 
of an SDK.</p><p>With the deployed engine running, open another temrinal and 
run the following <code>curl</code> command or use SDK to send the 
query:</p><div class="tabs"> <ul class="control"> <li data-lang
 ="json"><a href="#tab-1a422f43-68cd-4101-998f-4025717a237c">REST API</a></li> 
<li data-lang="python"><a 
href="#tab-705c9437-459c-4365-b991-633a89da532a">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-0b5a3317-8410-4551-a8e1-8286745e717d">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-f3b5e0e8-2476-4734-834f-ed465d0b0226">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-53a7d382-0334-4390-b059-4e8a9a2228f7">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-1a422f43-68cd-4101-998f-4025717a237c"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
 2
 3</pre></td> <td class="code"><pre><span class="gp">$ </span>curl -H <span 
class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
 -d <span class="s1">'{ "user": "1", "num": 4 }'</span> 
http://localhost:8000/queries.json
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-439706eb-c53c-416c-915d-708db9a6b9bf"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-705c9437-459c-4365-b991-633a89da532a"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3</pre></td> <td class="code"><pre><span class="kn">import</span> <span 
class="nn">predictionio</span>
 <span class="n">engine_client</span> <span class="o">=</span> <span 
class="n">predictionio</span><span class="o">.</span><span 
class="n">EngineClient</span><span class="p">(</span><span 
class="n">url</span><span class="o">=</span><span 
class="s">"http://localhost:8000";</span><span class="p">)</span>
 <span class="k">print</span> <span class="n">engine_client</span><span 
class="o">.</span><span class="n">send_query</span><span 
class="p">({</span><span class="s">"user"</span><span class="p">:</span> <span 
class="s">"1"</span><span class="p">,</span> <span class="s">"num"</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-81db23b7-4402-4955-a228-04126fd37c7e"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-0b5a3317-8410-4551-a8e1-8286745e717d"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -326,7 +326,7 @@ Your system is all ready to go.
 <span class="nb">print_r</span><span class="p">(</span><span 
class="nv">$response</span><span class="p">);</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-e6bfef5d-5d8a-4d3f-9e7b-340d5391fdc0"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-f3b5e0e8-2476-4734-834f-ed465d0b0226"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -339,7 +339,7 @@ Your system is all ready to go.
 <span class="n">response</span> <span class="o">=</span> <span 
class="n">client</span><span class="p">.</span><span 
class="nf">send_query</span><span class="p">(</span><span 
class="s1">'user'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="no">USER</span> <span 
class="no">ID</span><span class="o">&gt;</span><span class="p">,</span> <span 
class="s1">'num'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="no">NUMBER</span> <span 
class="p">(</span><span class="n">integer</span><span class="p">)</span><span 
class="o">&gt;</span><span class="p">)</span>
 
 <span class="nb">puts</span> <span class="n">response</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-5db3542e-1def-490e-be3a-da33967afd7f"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-53a7d382-0334-4390-b059-4e8a9a2228f7"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/recommendation/quickstart/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/quickstart/index.html.gz 
b/templates/recommendation/quickstart/index.html.gz
index 63da567..0c8e0ae 100644
Binary files a/templates/recommendation/quickstart/index.html.gz and 
b/templates/recommendation/quickstart/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/recommendation/reading-custom-events/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/reading-custom-events/index.html.gz 
b/templates/recommendation/reading-custom-events/index.html.gz
index 1ea0fbb..5664b3b 100644
Binary files a/templates/recommendation/reading-custom-events/index.html.gz and 
b/templates/recommendation/reading-custom-events/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/recommendation/training-with-implicit-preference/index.html.gz
----------------------------------------------------------------------
diff --git 
a/templates/recommendation/training-with-implicit-preference/index.html.gz 
b/templates/recommendation/training-with-implicit-preference/index.html.gz
index 18a02a7..12b4f88 100644
Binary files 
a/templates/recommendation/training-with-implicit-preference/index.html.gz and 
b/templates/recommendation/training-with-implicit-preference/index.html.gz 
differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/similarproduct/dase/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/similarproduct/dase/index.html.gz 
b/templates/similarproduct/dase/index.html.gz
index 276eb1c..55a4429 100644
Binary files a/templates/similarproduct/dase/index.html.gz and 
b/templates/similarproduct/dase/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/similarproduct/how-to/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/similarproduct/how-to/index.html.gz 
b/templates/similarproduct/how-to/index.html.gz
index 4888834..8a164f7 100644
Binary files a/templates/similarproduct/how-to/index.html.gz and 
b/templates/similarproduct/how-to/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/similarproduct/multi-events-multi-algos/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/similarproduct/multi-events-multi-algos/index.html.gz 
b/templates/similarproduct/multi-events-multi-algos/index.html.gz
index d502ffa..5bbd6d8 100644
Binary files a/templates/similarproduct/multi-events-multi-algos/index.html.gz 
and b/templates/similarproduct/multi-events-multi-algos/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/98fdb0a2/templates/similarproduct/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/similarproduct/quickstart/index.html 
b/templates/similarproduct/quickstart/index.html
index e3b95b1..f004a3c 100644
--- a/templates/similarproduct/quickstart/index.html
+++ b/templates/similarproduct/quickstart/index.html
@@ -32,7 +32,7 @@ Your system is all ready to go.
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span>               MyApp1 |    1 | 
3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F | <span 
class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span>               MyApp2 |    2 | 
io5lz6Eg4m3Xe4JZTBFE13GMAf1dhFl6ZteuJfrO84XpdOz9wRCrDU44EUaYuXq5 | <span 
class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span> Finished listing 2 app<span class="o">(</span>s<span 
class="o">)</span>.
-</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 
id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, 
let&#39;s collect some training data for the app of this Engine. By default, 
the Similar Product Engine Template supports 2 types of entities: 
<strong>user</strong> and <strong>item</strong>, and event 
<strong>view</strong>. An item has the <strong>categories</strong> property, 
which is a list of category names (String). A user can view an item. 
Respectively, this template requires &#39;$set&#39; user event, &#39;$set&#39; 
item event, and user-view-item events.</p><div class="alert-message 
info"><p>This template can easily be customized to consider more user events 
such as <em>buy</em>, <em>rate</em> and <em>like</em>.</p></div><p>You can send 
these events to PredictionIO Event Server in real-time easily by making a HTTP 
request or through the provided SDK. Please see <a href="/appintegration/">App 
Integration Overview</a> for more detail
 s how to integrate your app with SDK.</p><p>Let&#39;s try sending events to 
EventServer with the following <code>curl</code> commands (The corresponding 
SDK code is showed in other tabs).</p><p>Replace 
<code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in above steps. 
Note that <code>localhost:7070</code> is the default URL of the Event 
Server.</p><p>For convenience, set your access key to the shell variable, 
run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a 
href="#"></a></p> <p>For example, when a new user with id &quot;u0&quot; is 
created in your app on time <code>2014-11-02T09:39:45.618-08:00</code> (current 
time will be used if eventTime is not specified), you can send a 
<code>$set</code> event for this user. To send this event, run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-9c581939-984b-4dfd-b56b-714f96d48de9">REST 
API</a></li> <li data-lang="python"><a href="#tab-5b084a77-55d
 d-491a-bbc2-ba7b69016aa1">Python SDK</a></li> <li data-lang="php"><a 
href="#tab-6f027970-b7b5-4768-9146-41611f5764b1">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-f894ec85-33a1-4576-9035-aff92779a0ba">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-02f7fa11-dee8-46a8-ae69-22b10be92b13">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-9c581939-984b-4dfd-b56b-714f96d48de9"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 
id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, 
let&#39;s collect some training data for the app of this Engine. By default, 
the Similar Product Engine Template supports 2 types of entities: 
<strong>user</strong> and <strong>item</strong>, and event 
<strong>view</strong>. An item has the <strong>categories</strong> property, 
which is a list of category names (String). A user can view an item. 
Respectively, this template requires &#39;$set&#39; user event, &#39;$set&#39; 
item event, and user-view-item events.</p><div class="alert-message 
info"><p>This template can easily be customized to consider more user events 
such as <em>buy</em>, <em>rate</em> and <em>like</em>.</p></div><p>You can send 
these events to PredictionIO Event Server in real-time easily by making a HTTP 
request or through the provided SDK. Please see <a href="/appintegration/">App 
Integration Overview</a> for more detail
 s how to integrate your app with SDK.</p><p>Let&#39;s try sending events to 
EventServer with the following <code>curl</code> commands (The corresponding 
SDK code is showed in other tabs).</p><p>Replace 
<code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in above steps. 
Note that <code>localhost:7070</code> is the default URL of the Event 
Server.</p><p>For convenience, set your access key to the shell variable, 
run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a 
href="#"></a></p> <p>For example, when a new user with id &quot;u0&quot; is 
created in your app on time <code>2014-11-02T09:39:45.618-08:00</code> (current 
time will be used if eventTime is not specified), you can send a 
<code>$set</code> event for this user. To send this event, run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-93884c00-ea58-43e0-b8d9-b53cf641753b">REST 
API</a></li> <li data-lang="python"><a href="#tab-27155468-e29
 b-4682-af87-624b50c6b46e">Python SDK</a></li> <li data-lang="php"><a 
href="#tab-9d24da10-137d-4b5a-a388-37fbc8d1ac04">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-d81afcb2-d20c-4cbd-9c18-c48c2a87c79c">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-692d089a-aaf1-40cd-86fe-d3a4c2ade2ed">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-93884c00-ea58-43e0-b8d9-b53cf641753b"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -47,7 +47,7 @@ Your system is all ready to go.
   "entityId" : "u0",
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-5b084a77-55dd-491a-bbc2-ba7b69016aa1"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-27155468-e29b-4682-af87-624b50c6b46e"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -86,7 +86,7 @@ Your system is all ready to go.
   <span class="n">event_time</span><span class="o">=</span><span 
class="n">datetime</span><span class="p">(</span>
     <span class="mi">2014</span><span class="p">,</span> <span 
class="mi">11</span><span class="p">,</span> <span class="mo">02</span><span 
class="p">,</span> <span class="mi">09</span><span class="p">,</span> <span 
class="mi">39</span><span class="p">,</span> <span class="mi">45</span><span 
class="p">,</span> <span class="mi">618000</span><span class="p">,</span> <span 
class="n">pytz</span><span class="o">.</span><span 
class="n">timezone</span><span class="p">(</span><span 
class="s">'US/Pacific'</span><span class="p">)</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-6f027970-b7b5-4768-9146-41611f5764b1"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-9d24da10-137d-4b5a-a388-37fbc8d1ac04"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -111,7 +111,7 @@ Your system is all ready to go.
   <span class="s1">'entityId'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="nx">USER</span> <span 
class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-f894ec85-33a1-4576-9035-aff92779a0ba"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-d81afcb2-d20c-4cbd-9c18-c48c2a87c79c"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -128,7 +128,7 @@ Your system is all ready to go.
   <span class="s1">'user'</span><span class="p">,</span>
   <span class="o">&lt;</span><span class="no">USER</span> <span 
class="no">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-02f7fa11-dee8-46a8-ae69-22b10be92b13"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-692d089a-aaf1-40cd-86fe-d3a4c2ade2ed"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -153,7 +153,7 @@ Your system is all ready to go.
   <span class="o">.</span><span class="na">entityType</span><span 
class="o">(</span><span class="s">"user"</span><span class="o">)</span>
   <span class="o">.</span><span class="na">entityId</span><span 
class="o">(&lt;</span><span class="n">USER_ID</span><span 
class="o">&gt;);</span>
 <span class="n">client</span><span class="o">.</span><span 
class="na">createEvent</span><span class="o">(</span><span 
class="n">userEvent</span><span class="o">);</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a new item 
&quot;i0&quot; is created in your app on time 
<code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if 
eventTime is not specified), you can send a <code>$set</code> event for the 
item. Note that the item is set with categories properties: 
<code>&quot;c1&quot;</code> and <code>&quot;c2&quot;</code>. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-b21b2452-ee4c-4675-891a-795128a90db0">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-b0b15b00-5fcb-408a-9a28-84ab1f21341d">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-fad1594e-a287-479d-8ba3-9014619571a7">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-a5409934-ed96-4da8-9a6a-ad758a676c2b">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-6edce66e-29a4-422b-81f2-bf4a22204352">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-b21b24
 52-ee4c-4675-891a-795128a90db0"> <div class="highlight shell"> <table 
style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: 
right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a new item 
&quot;i0&quot; is created in your app on time 
<code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if 
eventTime is not specified), you can send a <code>$set</code> event for the 
item. Note that the item is set with categories properties: 
<code>&quot;c1&quot;</code> and <code>&quot;c2&quot;</code>. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-dc3f500f-61c6-4666-87a0-7f4ecb859cee">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-7a33aeca-ac60-426f-ac1a-2579b9c65682">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-d6019e8c-bfdc-4486-a20f-c7624e1a15f1">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-8f5a1de0-f8d0-44c6-b02a-007bb3bda632">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-b96caeda-b100-4b3b-9858-7219f5f70a0c">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-dc3f50
 0f-61c6-4666-87a0-7f4ecb859cee"> <div class="highlight shell"> <table 
style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: 
right"><pre class="lineno">1
 2
 3
 4
@@ -174,7 +174,7 @@ Your system is all ready to go.
   }
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-b0b15b00-5fcb-408a-9a28-84ab1f21341d"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-7a33aeca-ac60-426f-ac1a-2579b9c65682"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -193,7 +193,7 @@ Your system is all ready to go.
     <span class="s">"categories"</span> <span class="p">:</span> <span 
class="p">[</span><span class="s">"&lt;CATEGORY_1&gt;"</span><span 
class="p">,</span> <span class="s">"&lt;CATEGORY_2&gt;"</span><span 
class="p">]</span>
   <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-fad1594e-a287-479d-8ba3-9014619571a7"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-d6019e8c-bfdc-4486-a20f-c7624e1a15f1"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -214,7 +214,7 @@ Your system is all ready to go.
 <span class="p">));</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-a5409934-ed96-4da8-9a6a-ad758a676c2b"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-8f5a1de0-f8d0-44c6-b02a-007bb3bda632"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -231,7 +231,7 @@ Your system is all ready to go.
   <span class="p">}</span>
 <span class="p">)</span>
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-6edce66e-29a4-422b-81f2-bf4a22204352"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-b96caeda-b100-4b3b-9858-7219f5f70a0c"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -244,7 +244,7 @@ Your system is all ready to go.
   <span class="o">.</span><span class="na">entityId</span><span 
class="o">(&lt;</span><span class="n">ITEM_ID</span><span class="o">&gt;)</span>
   <span class="o">.</span><span class="na">property</span><span 
class="o">(</span><span class="s">"categories"</span><span class="o">,</span> 
<span class="n">ImmutableList</span><span class="o">.</span><span 
class="na">of</span><span class="o">(</span><span 
class="s">"&lt;CATEGORY_1&gt;"</span><span class="o">,</span> <span 
class="s">"&lt;CATEGORY_2&gt;"</span><span class="o">));</span>
 <span class="n">client</span><span class="o">.</span><span 
class="na">createEvent</span><span class="o">(</span><span 
class="n">itemEvent</span><span class="o">)</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When the user 
&quot;u0&quot; view item &quot;i0&quot; on time 
<code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if 
eventTime is not specified), you can send a view event. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-c0f3dd67-2fcb-4411-a79b-c073de436e23">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-3497f7d7-efee-42e1-b74b-393148aece16">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-c7b3482d-d55b-469f-a283-91710c51dfeb">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-ebebec80-4f52-486e-b302-479037cdad56">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-10d0c879-b926-4053-80ed-00a26ed0b74c">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-c0f3dd67-2fcb-4411-a79b-c073de436e23"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text
 -align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <p>When the user 
&quot;u0&quot; view item &quot;i0&quot; on time 
<code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if 
eventTime is not specified), you can send a view event. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-cad0641c-ad87-464f-bd85-306775db552a">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-958811d3-fe29-4613-a7be-126f49c35c20">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-ad2d8302-b001-474b-8e52-a93801d772af">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-b14001fd-9a70-430f-8aff-2219e577bb8a">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-ba89b19c-51d2-4343-819f-c4f7e553bec2">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-cad0641c-ad87-464f-bd85-306775db552a"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text
 -align: right"><pre class="lineno">1
 2
 3
 4
@@ -263,7 +263,7 @@ Your system is all ready to go.
   "targetEntityId" : "i0",
   "eventTime" : "2014-11-10T12:34:56.123-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-3497f7d7-efee-42e1-b74b-393148aece16"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-958811d3-fe29-4613-a7be-126f49c35c20"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -280,7 +280,7 @@ Your system is all ready to go.
   <span class="n">target_entity_type</span><span class="o">=</span><span 
class="s">"item"</span><span class="p">,</span>
   <span class="n">target_entity_id</span><span class="o">=&lt;</span><span 
class="n">ITEM</span> <span class="n">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-c7b3482d-d55b-469f-a283-91710c51dfeb"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-ad2d8302-b001-474b-8e52-a93801d772af"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -299,7 +299,7 @@ Your system is all ready to go.
    <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="nx">ITEM</span> <span 
class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-ebebec80-4f52-486e-b302-479037cdad56"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-b14001fd-9a70-430f-8aff-2219e577bb8a"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -316,7 +316,7 @@ Your system is all ready to go.
     <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> 
<span class="o">&lt;</span><span class="no">ITEM</span> <span 
class="no">ID</span><span class="o">&gt;</span>
   <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-10d0c879-b926-4053-80ed-00a26ed0b74c"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-ba89b19c-51d2-4343-819f-c4f7e553bec2"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -376,19 +376,19 @@ User u10 views item i29
 </pre></td></tr></tbody></table> </div> <p>When the engine is deployed 
successfully and running, you should see a console message similar to the 
following:</p><div class="highlight shell"><table style="border-spacing: 
0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre 
class="lineno">1
 2</pre></td><td class="code"><pre><span class="o">[</span>INFO] <span 
class="o">[</span>HttpListener] Bound to /0.0.0.0:8000
 <span class="o">[</span>INFO] <span class="o">[</span>MasterActor] Bind 
successful. Ready to serve.
-</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine 
process.</p><p>By default, the deployed engine binds to <a 
href="http://localhost:8000";><a 
href="http://localhost:8000";>http://localhost:8000</a></a>. You can visit that 
page in your web browser to check its status.</p><p><img alt="Engine Status" 
src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' 
class='header-anchors'>6. Use the Engine</h2><p>Now, You can retrieve predicted 
results. To retrieve 4 items which are similar to item ID &quot;i1&quot;. You 
send this JSON <code>{ &quot;items&quot;: [&quot;i1&quot;], &quot;num&quot;: 4 
}</code> to the deployed engine and it will return a JSON of the recommended 
items. Simply send a query by making a HTTP request or through the 
<code>EngineClient</code> of an SDK.</p><p>With the deployed engine running, 
open another temrinal and run the following <code>curl</code> command or use 
SDK to send the query:</p><div class="tabs"> <ul class="control
 "> <li data-lang="json"><a 
href="#tab-052f8f63-b225-446b-bbc1-3e56c093dc51">REST API</a></li> <li 
data-lang="python"><a href="#tab-40804a81-a599-4ea3-805b-c136d1e22a75">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-91265e70-84e7-4fe1-8a38-f65006b894ba">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-e19572a6-688d-43dd-a6a6-7736301385c1">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-5ba646f9-c603-4b39-8ed5-b8be581fb5e9">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-052f8f63-b225-446b-bbc1-3e56c093dc51"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine 
process.</p><p>By default, the deployed engine binds to <a 
href="http://localhost:8000";><a 
href="http://localhost:8000";>http://localhost:8000</a></a>. You can visit that 
page in your web browser to check its status.</p><p><img alt="Engine Status" 
src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' 
class='header-anchors'>6. Use the Engine</h2><p>Now, You can retrieve predicted 
results. To retrieve 4 items which are similar to item ID &quot;i1&quot;. You 
send this JSON <code>{ &quot;items&quot;: [&quot;i1&quot;], &quot;num&quot;: 4 
}</code> to the deployed engine and it will return a JSON of the recommended 
items. Simply send a query by making a HTTP request or through the 
<code>EngineClient</code> of an SDK.</p><p>With the deployed engine running, 
open another temrinal and run the following <code>curl</code> command or use 
SDK to send the query:</p><div class="tabs"> <ul class="control
 "> <li data-lang="json"><a 
href="#tab-ce1b72c3-d983-4d8e-9522-c856c90bce09">REST API</a></li> <li 
data-lang="python"><a href="#tab-2ad2f0fb-0199-43d9-9fcf-353074b69aa5">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-e601b51b-0a69-40c3-8360-22bf4a5de39f">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-c43a5dff-2cf6-45d4-b2b3-b5d3dc1f1f70">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-ce9079f1-eb4f-42a4-af32-38a4fe057736">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-ce1b72c3-d983-4d8e-9522-c856c90bce09"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
 2
 3
 4</pre></td> <td class="code"><pre><span class="gp">$ </span>curl -H <span 
class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
 -d <span class="s1">'{ "items": ["i1"], "num": 4 }'</span> <span 
class="se">\</span>
 http://localhost:8000/queries.json
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-40804a81-a599-4ea3-805b-c136d1e22a75"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-2ad2f0fb-0199-43d9-9fcf-353074b69aa5"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3</pre></td> <td class="code"><pre><span class="kn">import</span> <span 
class="nn">predictionio</span>
 <span class="n">engine_client</span> <span class="o">=</span> <span 
class="n">predictionio</span><span class="o">.</span><span 
class="n">EngineClient</span><span class="p">(</span><span 
class="n">url</span><span class="o">=</span><span 
class="s">"http://localhost:8000";</span><span class="p">)</span>
 <span class="k">print</span> <span class="n">engine_client</span><span 
class="o">.</span><span class="n">send_query</span><span 
class="p">({</span><span class="s">"items"</span><span class="p">:</span> <span 
class="p">[</span><span class="s">"i1"</span><span class="p">],</span> <span 
class="s">"num"</span><span class="p">:</span> <span class="mi">4</span><span 
class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-91265e70-84e7-4fe1-8a38-f65006b894ba"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-e601b51b-0a69-40c3-8360-22bf4a5de39f"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -407,7 +407,7 @@ http://localhost:8000/queries.json
 <span class="nb">print_r</span><span class="p">(</span><span 
class="nv">$response</span><span class="p">);</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-e19572a6-688d-43dd-a6a6-7736301385c1"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-c43a5dff-2cf6-45d4-b2b3-b5d3dc1f1f70"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -420,7 +420,7 @@ http://localhost:8000/queries.json
 <span class="n">response</span> <span class="o">=</span> <span 
class="n">client</span><span class="p">.</span><span 
class="nf">send_query</span><span class="p">(</span><span 
class="s1">'items'</span> <span class="o">=&gt;</span> <span 
class="p">[</span><span class="s1">'i1'</span><span class="p">],</span> <span 
class="s1">'num'</span> <span class="o">=&gt;</span> <span 
class="mi">4</span><span class="p">)</span>
 
 <span class="nb">puts</span> <span class="n">response</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-5ba646f9-c603-4b39-8ed5-b8be581fb5e9"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-ce9079f1-eb4f-42a4-af32-38a4fe057736"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4


Reply via email to