http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/e9d16bb2/templates/productranking/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/productranking/quickstart/index.html 
b/templates/productranking/quickstart/index.html
index b07311c..3db4977 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-1c39bee1-ae3b-47d8-a0e4-492cb87b5e4e">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-b8500dd7-7a19-4fed-83bb-8c1d44e1da1b">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-b7d47f2d-fb11-48f6-9b7e-08a02af48ccb">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-09509f4a-219c-4db7-ae9e-d91f79fa6304">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-b2c76333-8344-459c-
 8a39-3bec74c60873">Java SDK</a></li> </ul> <div data-tab="REST API" 
data-lang="json" id="tab-1c39bee1-ae3b-47d8-a0e4-492cb87b5e4e"> <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-c061eee6-34c2-408b-b840-c0026738de52">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-da1a6596-cb8e-4fbe-9ad6-00cc09980575">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-c160b392-ad5d-45f7-9900-09bd59f23a01">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-731afcc6-bc9c-42ae-be1b-3338f0d7b7b0">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-96834394-4bfa-4f69-
 86ad-f724d791630f">Java SDK</a></li> </ul> <div data-tab="REST API" 
data-lang="json" id="tab-c061eee6-34c2-408b-b840-c0026738de52"> <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-b8500dd7-7a19-4fed-83bb-8c1d44e1da1b"> <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-da1a6596-cb8e-4fbe-9ad6-00cc09980575"> <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-b7d47f2d-fb11-48f6-9b7e-08a02af48ccb"> <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-c160b392-ad5d-45f7-9900-09bd59f23a01"> <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-09509f4a-219c-4db7-ae9e-d91f79fa6304"> <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-731afcc6-bc9c-42ae-be1b-3338f0d7b7b0"> <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-b2c76333-8344-459c-8a39-3bec74c60873"> <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-96834394-4bfa-4f69-86ad-f724d791630f"> <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-703ba120-9352-477b-ba06-1ac0488d82eb">REST API</a></li> <li 
data-lang="python"><a href="#tab-34b1d9d7-4e1b-483c-8dfb-197d92b964ec">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-274e0a3d-6ff5-437a-b32f-eaae7f9ce6eb">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-ca4628ef-1045-4196-8ee3-77642cec6328">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-0ec59947-1a16-4e61-b690-00f2fd80cbd2">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-703ba120-9352-477b-ba06-1ac0488d82eb"> <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-58ccbe74-8764-49e2-a7fa-cabd15dbe797">REST API</a></li> <li 
data-lang="python"><a href="#tab-aa179c50-0bbf-40f6-b4ca-1bc31faa7a61">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-f87152f6-a00b-4109-92bb-4fe14c05277d">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-7e69fb6f-e25b-4f08-8abc-1580f145baeb">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-c1628143-52a7-4107-9836-de455330f612">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-58ccbe74-8764-49e2-a7fa-cabd15dbe797"> <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-34b1d9d7-4e1b-483c-8dfb-197d92b964ec"> <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-aa179c50-0bbf-40f6-b4ca-1bc31faa7a61"> <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-274e0a3d-6ff5-437a-b32f-eaae7f9ce6eb"> <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-f87152f6-a00b-4109-92bb-4fe14c05277d"> <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-ca4628ef-1045-4196-8ee3-77642cec6328"> <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-7e69fb6f-e25b-4f08-8abc-1580f145baeb"> <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-0ec59947-1a16-4e61-b690-00f2fd80cbd2"> <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-c1628143-52a7-4107-9836-de455330f612"> <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-4ff61cab-3959-49bf-9e98-1c77759dd597">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-6c3e584a-3356-458a-a089-1121f8f4c56f">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-4e0a6cc2-8128-4106-8268-24c233aa02b1">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-2a1f0623-6a05-408b-a10f-f02fa61e45a2">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-9a149a53-9dc3-4073-a764-54d9b31733e9">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-4ff61cab-3959-49bf-9e98-1c77759dd597"> <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-d46121c1-4848-4876-baf2-7392d21951f6">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-1660fd33-da54-4ef5-9159-e1d6dbe28269">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-ca3a6882-e5aa-490a-b24c-ad05c9ad4c59">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-4fc7cf97-d2d4-40ec-a268-b08f4a60941d">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-ceee83b0-d803-4718-8cd7-40184e879ffd">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-d46121c1-4848-4876-baf2-7392d21951f6"> <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-6c3e584a-3356-458a-a089-1121f8f4c56f"> <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-1660fd33-da54-4ef5-9159-e1d6dbe28269"> <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-4e0a6cc2-8128-4106-8268-24c233aa02b1"> <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-ca3a6882-e5aa-490a-b24c-ad05c9ad4c59"> <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-2a1f0623-6a05-408b-a10f-f02fa61e45a2"> <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-4fc7cf97-d2d4-40ec-a268-b08f4a60941d"> <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-9a149a53-9dc3-4073-a764-54d9b31733e9"> <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-ceee83b0-d803-4718-8cd7-40184e879ffd"> <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-52fecdf0-e91b-4e56-ad64-778c48c13637">REST API</a></li> <li 
data-lang="python"><a href="#tab-adc0502d-4bfa-43c5-b6cd-e840b7b56b95">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-f928f9b6-7e02-4a1c-84fc-8bbf5485768b">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-2aafb9d4-14ec-462b-91b0-7c4c05708f4c">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-dd66da65-4a1d-4bd6-99f1-dfc34cbc235f">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-52fecdf0-e91b-4e56-ad64-778c48c13637"> <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-84be279c-11a0-4ecf-8f23-46791a9f91d8">REST API</a></li> <li 
data-lang="python"><a href="#tab-08de79a9-0090-4fbf-a7d7-24d399ded26d">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-6d44a8d9-46f3-40db-a019-871a9a7ddb2b">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-0985b332-a9c3-453b-ae3f-010cd5b0a991">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-3ee8ed17-583c-460b-87d9-35853e28e8f2">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-84be279c-11a0-4ecf-8f23-46791a9f91d8"> <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-adc0502d-4bfa-43c5-b6cd-e840b7b56b95"> <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-08de79a9-0090-4fbf-a7d7-24d399ded26d"> <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-f928f9b6-7e02-4a1c-84fc-8bbf5485768b"> <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-6d44a8d9-46f3-40db-a019-871a9a7ddb2b"> <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-2aafb9d4-14ec-462b-91b0-7c4c05708f4c"> <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-0985b332-a9c3-453b-ae3f-010cd5b0a991"> <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-dd66da65-4a1d-4bd6-99f1-dfc34cbc235f"> <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-3ee8ed17-583c-460b-87d9-35853e28e8f2"> <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/e9d16bb2/templates/productranking/quickstart/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/productranking/quickstart/index.html.gz 
b/templates/productranking/quickstart/index.html.gz
index a5a176e..069bff5 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/e9d16bb2/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 6e782b2..1d24a48 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/e9d16bb2/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 af733e9..54e2407 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/e9d16bb2/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 362d32b..c443c9f 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/e9d16bb2/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 a8e345c..cf76030 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/e9d16bb2/templates/recommendation/dase/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/dase/index.html.gz 
b/templates/recommendation/dase/index.html.gz
index a1681de..3a213b0 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/e9d16bb2/templates/recommendation/evaluation/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/evaluation/index.html.gz 
b/templates/recommendation/evaluation/index.html.gz
index fd708a3..f141cfb 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/e9d16bb2/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 16a4e84..a0cab27 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/e9d16bb2/templates/recommendation/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/recommendation/quickstart/index.html 
b/templates/recommendation/quickstart/index.html
index 9242ed5..2c6ec13 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-a54da5f7-a0f7-4b6f-bb2c-877161435a5c">REST API</a></li> <li 
data-lang="python"><a href="#tab-bf89f0bd-53bd-4cd8-8cd7-dd068a9c8cb2">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-8d1a30d4-0202-43fe-a77e-30fd75f54d79">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-7284d66f-4249
 -470e-a698-7f6cf944c00f">Ruby SDK</a></li> <li data-lang="java"><a 
href="#tab-f2d39201-e71f-4ad1-89a1-68ce5bc83ff9">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-a54da5f7-a0f7-4b6f-bb2c-877161435a5c"> <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-0590d769-9281-4378-a31a-a2967ad4cd04">REST API</a></li> <li 
data-lang="python"><a href="#tab-675b5ebd-ec0f-4764-b434-c33ad9596592">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-cc3427ce-7137-41bd-9fa0-0087eea6a325">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-6d356fc2-51dc
 -46ac-a1cf-78b8aa9516b4">Ruby SDK</a></li> <li data-lang="java"><a 
href="#tab-b5402e7c-0d59-476f-8244-78d7f2e93996">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-0590d769-9281-4378-a31a-a2967ad4cd04"> <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-bf89f0bd-53bd-4cd8-8cd7-dd068a9c8cb2"> <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-675b5ebd-ec0f-4764-b434-c33ad9596592"> <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-8d1a30d4-0202-43fe-a77e-30fd75f54d79"> <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-cc3427ce-7137-41bd-9fa0-0087eea6a325"> <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-7284d66f-4249-470e-a698-7f6cf944c00f"> <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-6d356fc2-51dc-46ac-a1cf-78b8aa9516b4"> <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-f2d39201-e71f-4ad1-89a1-68ce5bc83ff9"> <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-b5402e7c-0d59-476f-8244-78d7f2e93996"> <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-adc43eae-2dfa-4ffd-a4b7-cedefe056d61">REST API</a></li> <li 
data-lang="python"><a href="#tab-3b4510a3-d17b-4622-a69f-a450165353ea">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-617320b0-fcf6-4cca-b169-474d0fed5625">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-666b9ba4-ff40-481d-9e37-1fb95d9b5dfe">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-3b60fb6e-141b-46a5-8766-988ddc5d2b70">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-adc43eae-2dfa-4ffd-a4b7-cedefe056d61"> <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-a571d2d4-4d2f-472c-af91-f8b4b214ae86">REST API</a></li> <li 
data-lang="python"><a href="#tab-7464c1b6-dce5-4533-b6a1-8e372abcf577">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-7dee77a9-ab62-4fb9-8ed0-8abf57b1f039">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-0b4a8fc9-7a65-4b42-877e-f4f17b7f2c19">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-afb36631-d978-4f98-972c-ba7dfcd98566">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-a571d2d4-4d2f-472c-af91-f8b4b214ae86"> <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-3b4510a3-d17b-4622-a69f-a450165353ea"> <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-7464c1b6-dce5-4533-b6a1-8e372abcf577"> <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-617320b0-fcf6-4cca-b169-474d0fed5625"> <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-7dee77a9-ab62-4fb9-8ed0-8abf57b1f039"> <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-666b9ba4-ff40-481d-9e37-1fb95d9b5dfe"> <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-0b4a8fc9-7a65-4b42-877e-f4f17b7f2c19"> <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-3b60fb6e-141b-46a5-8766-988ddc5d2b70"> <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-afb36631-d978-4f98-972c-ba7dfcd98566"> <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-6e2525db-98ac-4201-88b6-8f3160fd8d25">REST API</a></li> 
<li data-lang="python"><a 
href="#tab-193b5e51-618f-4b74-a695-b19288a9b489">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-478b17de-5455-44be-bbc0-9fa067e1bd8b">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-a37e793a-5dee-4b75-85c0-0d924fa0e825">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-d890c2b5-c15b-4b82-a763-79989ef42fdc">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-6e2525db-98ac-4201-88b6-8f3160fd8d25"> <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-8ff937e4-f720-46c8-81c1-72d27c398fb6">REST API</a></li> 
<li data-lang="python"><a 
href="#tab-9ae3dab2-4959-4a85-98f1-e38d6b55f199">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-add2baea-45ef-4ee5-b8d0-51a65e707998">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-4f3df731-b24e-4795-9162-f5276dc6f6c1">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-53051880-a6fb-487e-ae75-b03a0f10271a">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-8ff937e4-f720-46c8-81c1-72d27c398fb6"> <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-193b5e51-618f-4b74-a695-b19288a9b489"> <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-9ae3dab2-4959-4a85-98f1-e38d6b55f199"> <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-478b17de-5455-44be-bbc0-9fa067e1bd8b"> <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-add2baea-45ef-4ee5-b8d0-51a65e707998"> <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-a37e793a-5dee-4b75-85c0-0d924fa0e825"> <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-4f3df731-b24e-4795-9162-f5276dc6f6c1"> <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-d890c2b5-c15b-4b82-a763-79989ef42fdc"> <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-53051880-a6fb-487e-ae75-b03a0f10271a"> <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/e9d16bb2/templates/recommendation/quickstart/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/quickstart/index.html.gz 
b/templates/recommendation/quickstart/index.html.gz
index fe58c0e..46b5c37 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/e9d16bb2/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 0a48e04..3c7fc1e 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/e9d16bb2/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 17c95ce..8d37906 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/e9d16bb2/templates/similarproduct/dase/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/similarproduct/dase/index.html.gz 
b/templates/similarproduct/dase/index.html.gz
index 673fd33..9af31b0 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/e9d16bb2/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 384cd8a..59b25ee 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/e9d16bb2/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 2847f94..9c0d83b 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/e9d16bb2/templates/similarproduct/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/similarproduct/quickstart/index.html 
b/templates/similarproduct/quickstart/index.html
index 4c3aba7..0b3b8d9 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-9eb22de9-7212-4daa-a8df-4744864c9280">REST 
API</a></li> <li data-lang="python"><a href="#tab-cc71a62e-56a
 3-43c6-b32e-90fdc512f616">Python SDK</a></li> <li data-lang="php"><a 
href="#tab-b226c6f0-1087-4c9d-9792-4b426118c15d">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-cb188c33-39e9-49e6-a043-3eba5fb44f08">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-5a460411-8116-4ca3-9e1e-00c28d604ec9">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-9eb22de9-7212-4daa-a8df-4744864c9280"> <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-c26a5360-d152-47e1-b2e2-65c4e392a104">REST 
API</a></li> <li data-lang="python"><a href="#tab-bd7350c4-b7d
 4-4ea0-ad5f-4271399e283e">Python SDK</a></li> <li data-lang="php"><a 
href="#tab-ce30099d-8588-41cd-ae37-2c1865d90d8c">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-a9e3af52-b3a9-4ab5-aff8-5d065487d019">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-f43dfc65-ba32-4e03-9c0f-7f2db776e288">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-c26a5360-d152-47e1-b2e2-65c4e392a104"> <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-cc71a62e-56a3-43c6-b32e-90fdc512f616"> <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-bd7350c4-b7d4-4ea0-ad5f-4271399e283e"> <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-b226c6f0-1087-4c9d-9792-4b426118c15d"> <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-ce30099d-8588-41cd-ae37-2c1865d90d8c"> <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-cb188c33-39e9-49e6-a043-3eba5fb44f08"> <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-a9e3af52-b3a9-4ab5-aff8-5d065487d019"> <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-5a460411-8116-4ca3-9e1e-00c28d604ec9"> <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-f43dfc65-ba32-4e03-9c0f-7f2db776e288"> <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-eb4f8389-7bf6-44bf-ab42-9bdcb9a88686">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-1d41ac3a-5500-4cc4-a670-857076dfa158">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-fda44a80-91ed-45af-8453-115e045c1919">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-9d705c8f-343d-4624-a070-e8f40df75d1d">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-0a4a01e4-87fc-4633-928e-13140028b5cf">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-eb4f83
 89-7bf6-44bf-ab42-9bdcb9a88686"> <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-5378effe-78b7-4f8b-bcab-36bbe65e208f">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-28de7a65-3325-4ca5-90c3-a8884e91f44b">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-f0a060eb-0dff-4af1-aeff-1337d6a40b51">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-151a1255-2506-4ebb-ad72-e02b98602e58">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-6821e17e-ccc1-4888-a079-d7710b170802">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-5378ef
 fe-78b7-4f8b-bcab-36bbe65e208f"> <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-1d41ac3a-5500-4cc4-a670-857076dfa158"> <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-28de7a65-3325-4ca5-90c3-a8884e91f44b"> <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-fda44a80-91ed-45af-8453-115e045c1919"> <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-f0a060eb-0dff-4af1-aeff-1337d6a40b51"> <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-9d705c8f-343d-4624-a070-e8f40df75d1d"> <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-151a1255-2506-4ebb-ad72-e02b98602e58"> <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-0a4a01e4-87fc-4633-928e-13140028b5cf"> <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-6821e17e-ccc1-4888-a079-d7710b170802"> <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-150c86b1-8fde-490e-b582-df6c5bfdd23b">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-b9a85c26-93e9-4aa6-aa78-e49feff1cdef">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-20503514-b4a1-466a-8740-fb51331efd61">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-36a05158-8c5a-470b-812d-ee524e5499ed">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-45a82afd-6a64-44ea-aa81-9d0c760baf7e">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-150c86b1-8fde-490e-b582-df6c5bfdd23b"> <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-a7031f35-1dda-4d66-b07c-741af8badec2">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-a422366b-be86-429d-beea-4f73fec99fbd">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-d21778de-b660-4d38-9125-8f35d53fca6d">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-aa727219-46e8-4fcd-8469-521390ffd8b5">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-c057e491-ee69-4f5d-b333-7966b7aa70fc">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-a7031f35-1dda-4d66-b07c-741af8badec2"> <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-b9a85c26-93e9-4aa6-aa78-e49feff1cdef"> <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-a422366b-be86-429d-beea-4f73fec99fbd"> <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-20503514-b4a1-466a-8740-fb51331efd61"> <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-d21778de-b660-4d38-9125-8f35d53fca6d"> <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-36a05158-8c5a-470b-812d-ee524e5499ed"> <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-aa727219-46e8-4fcd-8469-521390ffd8b5"> <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-45a82afd-6a64-44ea-aa81-9d0c760baf7e"> <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-c057e491-ee69-4f5d-b333-7966b7aa70fc"> <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-fc795e91-e474-48ba-aa84-e4b7e5c8a3f7">REST API</a></li> <li 
data-lang="python"><a href="#tab-025b7776-42b5-4605-89fb-d878215dbe8f">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-d67e9fc3-1975-4af1-85c7-19b033d28b31">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-f59eb59a-39a8-466a-b088-c3db9371480f">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-37ab2dcd-cfe9-465c-b7f0-35dfb7be2cf3">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-fc795e91-e474-48ba-aa84-e4b7e5c8a3f7"> <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-111df85e-d428-46f5-b1fe-213058e09259">REST API</a></li> <li 
data-lang="python"><a href="#tab-c1072756-ceba-4897-b0c2-d6c7a3e553d3">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-f4d7967c-bd73-40a3-ad3e-c9daed09270f">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-e2639894-f6dd-4f39-bc2d-c777471e43a0">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-69ff0e58-83e5-4361-89ed-79176368cd6d">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-111df85e-d428-46f5-b1fe-213058e09259"> <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-025b7776-42b5-4605-89fb-d878215dbe8f"> <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-c1072756-ceba-4897-b0c2-d6c7a3e553d3"> <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-d67e9fc3-1975-4af1-85c7-19b033d28b31"> <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-f4d7967c-bd73-40a3-ad3e-c9daed09270f"> <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-f59eb59a-39a8-466a-b088-c3db9371480f"> <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-e2639894-f6dd-4f39-bc2d-c777471e43a0"> <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-37ab2dcd-cfe9-465c-b7f0-35dfb7be2cf3"> <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-69ff0e58-83e5-4361-89ed-79176368cd6d"> <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