http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/8d2697f7/templates/javaecommercerecommendation/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/javaecommercerecommendation/quickstart/index.html 
b/templates/javaecommercerecommendation/quickstart/index.html
index c567dda..0a5ba34 100644
--- a/templates/javaecommercerecommendation/quickstart/index.html
+++ b/templates/javaecommercerecommendation/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 training data for this Engine. By default, the E-Commerce 
Recommendation Engine Template supports 2 types of entities and 2 events: 
<strong>user</strong> and <strong>item</strong>; events <strong>view</strong> 
and <strong>buy</strong>. An item has the <strong>categories</strong> property, 
which is a list of category names (String). A user can view and buy an item. 
The specical <strong>constraint</strong> entiy with entityId 
<strong>unavailableItems</strong> defines a list of unavailable items and is 
taken into account in realtime during serving.</p><p>In summary, this template 
requires &#39;$set&#39; user event, &#39;$set&#39; item event, user-view-item 
events, user-buy-item event and &#39;$set&#39; constraint event.</p><div 
class="alert-message info"><p>This template can easily be customized to 
consider other user-to-it
 em events.</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 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-c942072f-8ddd-461b-ad74-490b31f8e2f3">REST API</a></li> <li 
data-lang="python"><a href="#tab-4a905052-d702-49db-b6c4-15ad209eaa3d">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-d9aeafc8-71c5-40ae-92e2-0ba7ba21fab4">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-50408b5b-28b2-4e15-aef7-2abf2af1011e">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-ec23fca9-ddb5-4aa8-8c75-3b3b63b7502e">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-c942072f-8ddd-461b-ad74-490b31f8e2f3"> <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 training data for this Engine. By default, the E-Commerce 
Recommendation Engine Template supports 2 types of entities and 2 events: 
<strong>user</strong> and <strong>item</strong>; events <strong>view</strong> 
and <strong>buy</strong>. An item has the <strong>categories</strong> property, 
which is a list of category names (String). A user can view and buy an item. 
The specical <strong>constraint</strong> entiy with entityId 
<strong>unavailableItems</strong> defines a list of unavailable items and is 
taken into account in realtime during serving.</p><p>In summary, this template 
requires &#39;$set&#39; user event, &#39;$set&#39; item event, user-view-item 
events, user-buy-item event and &#39;$set&#39; constraint event.</p><div 
class="alert-message info"><p>This template can easily be customized to 
consider other user-to-it
 em events.</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 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-a0f6a209-7b41-493d-bbc0-d01b81587298">REST API</a></li> <li 
data-lang="python"><a href="#tab-d265d7e9-7fbf-472e-b3e0-ac8502507855">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-66b99928-2ca4-4200-b67e-3776e2516cdc">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-20143ced-8d47-4c52-ad18-9b5a0e41806e">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-82309ed0-e23d-4500-8937-7ff807d7f9de">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-a0f6a209-7b41-493d-bbc0-d01b81587298"> <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-4a905052-d702-49db-b6c4-15ad209eaa3d"> <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-d265d7e9-7fbf-472e-b3e0-ac8502507855"> <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-d9aeafc8-71c5-40ae-92e2-0ba7ba21fab4"> <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-66b99928-2ca4-4200-b67e-3776e2516cdc"> <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
@@ -119,7 +119,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">'categories'</span> <span class="o">=&gt;</span> <span 
class="k">array</span><span class="p">(</span><span 
class="s1">'&lt;CATEGORY_1&gt;'</span><span class="p">,</span> <span 
class="s1">'&lt;CATEGORY_2&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-50408b5b-28b2-4e15-aef7-2abf2af1011e"> <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-20143ced-8d47-4c52-ad18-9b5a0e41806e"> <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
@@ -136,7 +136,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-ec23fca9-ddb5-4aa8-8c75-3b3b63b7502e"> <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-82309ed0-e23d-4500-8937-7ff807d7f9de"> <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
@@ -161,7 +161,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-e674ebf9-a63b-4bd1-b43d-76b6ffe7e70f">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-5a22102f-1df7-41e9-b293-ded9eb60602b">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-7fe9e5a0-15b0-4364-9767-3f7156f6b91f">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-2c93f2b9-4f3c-44c5-84c1-855b574437ff">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-f34d4644-1195-40f0-9d89-4cda9d5c6bba">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-e674eb
 f9-a63b-4bd1-b43d-76b6ffe7e70f"> <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-d899a721-6325-483c-90d1-6a062b65bab7">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-1f12eaee-c5b4-4753-8fd5-9a9eb05b03c8">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-c68b34ee-3c4e-42d2-b584-33bedb201958">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-3caa9065-3c2b-41e0-b944-9593986d0a8c">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-16f297da-a426-42cd-a94b-04eeb00dac52">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-d899a7
 21-6325-483c-90d1-6a062b65bab7"> <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
@@ -182,7 +182,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-5a22102f-1df7-41e9-b293-ded9eb60602b"> <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-1f12eaee-c5b4-4753-8fd5-9a9eb05b03c8"> <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
@@ -201,7 +201,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-7fe9e5a0-15b0-4364-9767-3f7156f6b91f"> <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-c68b34ee-3c4e-42d2-b584-33bedb201958"> <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
@@ -218,7 +218,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">'categories'</span> <span class="o">=&gt;</span> <span 
class="k">array</span><span class="p">(</span><span 
class="s1">'&lt;CATEGORY_1&gt;'</span><span class="p">,</span> <span 
class="s1">'&lt;CATEGORY_2&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-2c93f2b9-4f3c-44c5-84c1-855b574437ff"> <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-3caa9065-3c2b-41e0-b944-9593986d0a8c"> <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
@@ -235,7 +235,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-f34d4644-1195-40f0-9d89-4cda9d5c6bba"> <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-16f297da-a426-42cd-a94b-04eeb00dac52"> <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
@@ -248,7 +248,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>The properties of 
the <code>user</code> and <code>item</code> can be set, unset, or delete by 
special events <strong>$set</strong>, <strong>$unset</strong> and 
<strong>$delete</strong>. Please refer to <a 
href="/datacollection/eventapi/#note-about-properties">Event API</a> for more 
details of using these events.</p><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-638cd95a-b8c0-4ed4-9c07-b4a702d6a74c">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-168e1fb9-42cd-4ff7-9206-c2ba2f4487a8">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-e6e992eb-91b0-469d-804a-a06299f581ce">PHP 
SDK</a></li> <li data-lang="ruby"><a href="#tab-4306db41-0992-4727-a22c-0723fc
 acc235">Ruby SDK</a></li> <li data-lang="java"><a 
href="#tab-32e4d5db-769d-48f8-a69d-34aa58bea811">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-638cd95a-b8c0-4ed4-9c07-b4a702d6a74c"> <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>The properties of 
the <code>user</code> and <code>item</code> can be set, unset, or delete by 
special events <strong>$set</strong>, <strong>$unset</strong> and 
<strong>$delete</strong>. Please refer to <a 
href="/datacollection/eventapi/#note-about-properties">Event API</a> for more 
details of using these events.</p><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-35bb0854-5f17-4dc7-9178-d74afc54da6e">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-a931107c-f49e-45ec-851c-de4e7af2359a">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-960fa79c-1441-4e50-b72d-6e01009f4d8b">PHP 
SDK</a></li> <li data-lang="ruby"><a href="#tab-e05a0fca-69d9-4b57-a3be-d42524
 ecd524">Ruby SDK</a></li> <li data-lang="java"><a 
href="#tab-1e10189a-0a18-4f4e-ad29-9cd8377e602a">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-35bb0854-5f17-4dc7-9178-d74afc54da6e"> <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
@@ -267,7 +267,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-168e1fb9-42cd-4ff7-9206-c2ba2f4487a8"> <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-a931107c-f49e-45ec-851c-de4e7af2359a"> <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
@@ -284,7 +284,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-e6e992eb-91b0-469d-804a-a06299f581ce"> <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-960fa79c-1441-4e50-b72d-6e01009f4d8b"> <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
@@ -303,7 +303,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-4306db41-0992-4727-a22c-0723fcacc235"> <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-e05a0fca-69d9-4b57-a3be-d42524ecd524"> <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
@@ -322,7 +322,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-32e4d5db-769d-48f8-a69d-34aa58bea811"> <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-1e10189a-0a18-4f4e-ad29-9cd8377e602a"> <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
@@ -337,7 +337,7 @@ Your system is all ready to go.
     <span class="o">.</span><span class="na">targetEntityType</span><span 
class="o">(</span><span class="s">"item"</span><span class="o">)</span>
     <span class="o">.</span><span class="na">targetEntityId</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">viewEvent</span><span class="o">);</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When the user 
&quot;u0&quot; buy item &quot;i0&quot; on time 
<code>2014-11-10T13:00:00.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-af555c85-da43-4532-a64e-ff8e85e6b2b7">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-c9fd0900-2ae8-4762-ae15-d5af5369d4a2">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-e900ef9b-16ff-43bd-93ca-962c6a020b37">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-729c1585-b144-4e17-aebc-e03a7628afa0">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-573e283e-bed3-4fbe-b54c-d2e286dfb087">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-af555c85-da43-4532-a64e-ff8e85e6b2b7"> <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; buy item &quot;i0&quot; on time 
<code>2014-11-10T13:00:00.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-52dcf57d-dd43-4f00-b8dc-bb6dd6b1ca30">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-90ad14d7-74d5-44aa-8677-3077f437af51">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-88a6c568-a602-4e4e-b8c5-00968b94451e">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-a5d7d4a2-5e53-458b-b771-2f18234d3663">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-9fe95699-71bb-4342-8ec8-43c06264ee28">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-52dcf57d-dd43-4f00-b8dc-bb6dd6b1ca30"> <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
@@ -356,7 +356,7 @@ Your system is all ready to go.
   "targetEntityId" : "i0",
   "eventTime" : "2014-11-10T13:00:00.123-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-c9fd0900-2ae8-4762-ae15-d5af5369d4a2"> <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-90ad14d7-74d5-44aa-8677-3077f437af51"> <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
@@ -373,7 +373,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-e900ef9b-16ff-43bd-93ca-962c6a020b37"> <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-88a6c568-a602-4e4e-b8c5-00968b94451e"> <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
@@ -392,7 +392,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-729c1585-b144-4e17-aebc-e03a7628afa0"> <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-a5d7d4a2-5e53-458b-b771-2f18234d3663"> <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
@@ -409,7 +409,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-573e283e-bed3-4fbe-b54c-d2e286dfb087"> <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-9fe95699-71bb-4342-8ec8-43c06264ee28"> <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
@@ -490,19 +490,19 @@ User u10 buys item i40
 </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 recommend 4 items to user ID &quot;u1&quot;. You send this JSON 
<code>{ &quot;userEntityId&quot;: &quot;u1&quot;, &quot;number&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 terminal and run the following <code>curl</code> command or use 
SDK to send the query:</p><div class="tabs"> <ul class="control"> <li da
 ta-lang="json"><a href="#tab-9ee28001-6904-481f-adea-a825854d05e1">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-412e8f91-b4fb-40ca-8b6e-2946904f7850">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-e497f63e-5e4d-4354-b6d0-3ce45240b0aa">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-8fa2998a-770e-48bc-842f-52d7c8b8de26">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-6d89d2d3-7c3e-425e-97a6-224fef3748f1">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-9ee28001-6904-481f-adea-a825854d05e1"> <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 recommend 4 items to user ID &quot;u1&quot;. You send this JSON 
<code>{ &quot;userEntityId&quot;: &quot;u1&quot;, &quot;number&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 terminal and run the following <code>curl</code> command or use 
SDK to send the query:</p><div class="tabs"> <ul class="control"> <li da
 ta-lang="json"><a href="#tab-8f755ace-773b-4b58-9c16-d6a1696e8e0c">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-d1325cd5-05cd-4ba8-bb4e-fdc51d35b1f0">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-8e6cf5e4-128e-4b7d-a4f9-3be0d0599eed">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-a4ee3907-7071-4ede-a948-bf8dcc5b0b7c">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-d3d1bbaf-a3ec-4589-afa2-0965aa1bc0db">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-8f755ace-773b-4b58-9c16-d6a1696e8e0c"> <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">'{ "userEntityId": "u1", "number": 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-412e8f91-b4fb-40ca-8b6e-2946904f7850"> <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-d1325cd5-05cd-4ba8-bb4e-fdc51d35b1f0"> <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">"userEntityId"</span><span 
class="p">:</span> <span class="s">"u1"</span><span class="p">,</span> <span 
class="s">"number"</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-e497f63e-5e4d-4354-b6d0-3ce45240b0aa"> <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-8e6cf5e4-128e-4b7d-a4f9-3be0d0599eed"> <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
@@ -521,7 +521,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-8fa2998a-770e-48bc-842f-52d7c8b8de26"> <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-a4ee3907-7071-4ede-a948-bf8dcc5b0b7c"> <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
@@ -534,7 +534,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">'userEntityId'</span> <span class="o">=&gt;</span> <span 
class="s1">'i1'</span><span class="p">,</span> <span class="s1">'number'</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-6d89d2d3-7c3e-425e-97a6-224fef3748f1"> <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-d3d1bbaf-a3ec-4589-afa2-0965aa1bc0db"> <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
@@ -578,7 +578,7 @@ http://localhost:8000/queries.json
     <span class="o">{</span><span class="s2">"itemEntityId"</span>:<span 
class="s2">"i3"</span>,<span 
class="s2">"score"</span>:0.003007015026561692<span class="o">}</span>
   <span class="o">]</span>
 <span class="o">}</span>
-</pre></td></tr></tbody></table> </div> <p><em>MyECommerceRecommendation</em> 
is now running.</p> <div class="alert-message info"><p>To update the model 
periodically with new data, simply set up a cron job to call <code>pio 
train</code> and <code>pio deploy</code>. The engine will continue to serve 
prediction results during the re-train process. After the training is 
completed, <code>pio deploy</code> will automatically shutdown the existing 
engine server and bring up a new process on the same port.</p></div><div 
class="alert-message info"><p><strong>Note that if you import a <em>large</em> 
data set</strong> and the training seems to be taking forever or getting stuck, 
it&#39;s likely that there is not enough executor memory. It&#39;s recommended 
to setup a Spark standalone cluster, you&#39;ll need to specify more driver and 
executor memory when training with a large data set. Please see <a 
href="/resources/faq/#engine-training">FAQ here</a> for instructions.</p></div> 
<h2 id='setti
 ng-constraint-&quot;unavailableitems&quot;' class='header-anchors'>Setting 
constraint &quot;unavailableItems&quot;</h2><p>Now let&#39;s send an item 
constraint &quot;unavailableItems&quot; (replace accessKey with your Access 
Key):</p><div class="alert-message note"><p>You can also use SDK to send this 
event as described in the SDK sample above.</p></div><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-66a6c267-e4d1-4658-9878-513a6c81f610">REST API</a></li> <li 
data-lang="python"><a href="#tab-2ec6fac4-6761-446b-ac96-1a19dfa4c27d">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-49f26eca-0a1c-44e7-8c66-40260b017c29">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-97208cab-72aa-4c8c-ac3d-209a81515447">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-6f47a165-b7f2-43be-b9f4-d2738e730f05">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-66a6c267-e4d1-4658-9878-513a6c81f610"> <div class="highlight shell"> 
<table style="borde
 r-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre 
class="lineno">1
+</pre></td></tr></tbody></table> </div> <p><em>MyECommerceRecommendation</em> 
is now running.</p> <div class="alert-message info"><p>To update the model 
periodically with new data, simply set up a cron job to call <code>pio 
train</code> and <code>pio deploy</code>. The engine will continue to serve 
prediction results during the re-train process. After the training is 
completed, <code>pio deploy</code> will automatically shutdown the existing 
engine server and bring up a new process on the same port.</p></div><div 
class="alert-message info"><p><strong>Note that if you import a <em>large</em> 
data set</strong> and the training seems to be taking forever or getting stuck, 
it&#39;s likely that there is not enough executor memory. It&#39;s recommended 
to setup a Spark standalone cluster, you&#39;ll need to specify more driver and 
executor memory when training with a large data set. Please see <a 
href="/resources/faq/#engine-training">FAQ here</a> for instructions.</p></div> 
<h2 id='setti
 ng-constraint-&quot;unavailableitems&quot;' class='header-anchors'>Setting 
constraint &quot;unavailableItems&quot;</h2><p>Now let&#39;s send an item 
constraint &quot;unavailableItems&quot; (replace accessKey with your Access 
Key):</p><div class="alert-message note"><p>You can also use SDK to send this 
event as described in the SDK sample above.</p></div><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-ce3e4ed4-b2fc-4930-beab-bf97f0ba9197">REST API</a></li> <li 
data-lang="python"><a href="#tab-2e73699c-cd48-478a-87ef-201a624e55a9">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-453e3c17-1dc6-4420-a615-06191feb7514">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-f4acf6d0-951c-44da-9e9a-1015643e1b74">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-caca6ce7-4065-4ed5-bf24-2ad5d3578290">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-ce3e4ed4-b2fc-4930-beab-bf97f0ba9197"> <div class="highlight shell"> 
<table style="borde
 r-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre 
class="lineno">1
 2
 3
 4
@@ -599,7 +599,7 @@ http://localhost:8000/queries.json
   }
   "eventTime" : "2015-02-17T02:11:21.934Z"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-2ec6fac4-6761-446b-ac96-1a19dfa4c27d"> <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-2e73699c-cd48-478a-87ef-201a624e55a9"> <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
@@ -618,7 +618,7 @@ http://localhost:8000/queries.json
     <span class="s">"items"</span> <span class="p">:</span> <span 
class="p">[</span><span class="s">"&lt;ITEM ID1&gt;"</span><span 
class="p">,</span> <span class="s">"&lt;ITEM ID2&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-49f26eca-0a1c-44e7-8c66-40260b017c29"> <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-453e3c17-1dc6-4420-a615-06191feb7514"> <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
@@ -635,7 +635,7 @@ http://localhost:8000/queries.json
   <span class="s1">'properties'</span> <span class="o">=&gt;</span> <span 
class="k">array</span><span class="p">(</span><span class="s1">'items'</span> 
<span class="o">=&gt;</span> <span class="k">array</span><span 
class="p">(</span><span class="s1">'&lt;ITEM ID1&gt;'</span><span 
class="p">,</span> <span class="s1">'&lt;ITEM ID2&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-97208cab-72aa-4c8c-ac3d-209a81515447"> <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-f4acf6d0-951c-44da-9e9a-1015643e1b74"> <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
@@ -650,7 +650,7 @@ http://localhost:8000/queries.json
     <span class="s1">'properties'</span> <span class="o">=&gt;</span> <span 
class="p">{</span> <span class="s1">'items'</span> <span class="o">=&gt;</span> 
<span class="p">[</span><span class="s1">'&lt;ITEM ID1&gt;'</span><span 
class="p">,</span> <span class="s1">'&lt;ITEM ID2&gt;'</span><span 
class="p">]</span> <span class="p">}</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-6f47a165-b7f2-43be-b9f4-d2738e730f05"> <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-caca6ce7-4065-4ed5-bf24-2ad5d3578290"> <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/predictionio-site/blob/8d2697f7/templates/leadscoring/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/leadscoring/quickstart/index.html 
b/templates/leadscoring/quickstart/index.html
index 68ebe47..70b34ae 100644
--- a/templates/leadscoring/quickstart/index.html
+++ b/templates/leadscoring/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 training data for this Engine. By default, Lead Scoring 
Engine Template supports the following entities: <strong>user</strong>, 
<strong>page</strong>, and <strong>item</strong>. An user views a page, and 
buys an item.</p><p>Note that a &quot;sessionId&quot; property is required to 
indicate these events happen in the same session. In the first visit of a user, 
you should specify the optional &quot;referrral ID&quot; and 
&quot;browser&quot; information. These are used to determine where the user 
comes from and the browser information.</p><p>In summary, this template 
requires user-view-page event and user-buy-item events with the session ID, 
referrer ID and browser properties.</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. 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 an user with ID u0 views a URL page &quot;example.com/page0&quot; 
on time <code>2014-11-02T09:39:45.618-08:00</code>, with session ID 
&quot;akdj230fj8ass&quot; (current time will be used if eventTime is not 
specified) you can send the event to Event Server. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-f27733de-99bc-44a6-
 9d7d-8f06851b5b5b">REST API</a></li> <li data-lang="python"><a 
href="#tab-f7f43556-0d39-4594-aac6-e27c5ba697ad">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-c5a3144d-b4c9-4357-a605-85307826aebf">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-2926aa8a-9a27-459b-ab59-d05506c9909d">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-ed3ca737-cc47-40c9-9779-7087f3ff3097">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-f27733de-99bc-44a6-9d7d-8f06851b5b5b"> <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 training data for this Engine. By default, Lead Scoring 
Engine Template supports the following entities: <strong>user</strong>, 
<strong>page</strong>, and <strong>item</strong>. An user views a page, and 
buys an item.</p><p>Note that a &quot;sessionId&quot; property is required to 
indicate these events happen in the same session. In the first visit of a user, 
you should specify the optional &quot;referrral ID&quot; and 
&quot;browser&quot; information. These are used to determine where the user 
comes from and the browser information.</p><p>In summary, this template 
requires user-view-page event and user-buy-item events with the session ID, 
referrer ID and browser properties.</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. 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 an user with ID u0 views a URL page &quot;example.com/page0&quot; 
on time <code>2014-11-02T09:39:45.618-08:00</code>, with session ID 
&quot;akdj230fj8ass&quot; (current time will be used if eventTime is not 
specified) you can send the event to Event Server. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-419a2822-7de1-4259-
 831b-cf942abb0523">REST API</a></li> <li data-lang="python"><a 
href="#tab-3bae4c45-804b-4c26-83ba-aae032a30169">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-a1c432a4-2c70-4bce-9790-bf64d7fa0ece">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-bfd4d139-1ecf-4530-b3fe-31ba5a626cf9">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-c6773d4a-3caa-4b35-9f93-17cbf51bb7c2">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-419a2822-7de1-4259-831b-cf942abb0523"> <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
@@ -61,7 +61,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-f7f43556-0d39-4594-aac6-e27c5ba697ad"> <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-3bae4c45-804b-4c26-83ba-aae032a30169"> <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
@@ -106,7 +106,7 @@ Your system is all ready to go.
     <span class="s">"browser"</span><span class="p">:</span> <span 
class="o">&lt;</span><span class="n">BROWSER</span><span class="o">&gt;</span> 
<span class="c"># optinal. but should specify this if you have this information 
when user views the landing page</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-c5a3144d-b4c9-4357-a605-85307826aebf"> <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-a1c432a4-2c70-4bce-9790-bf64d7fa0ece"> <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
@@ -145,7 +145,7 @@ Your system is all ready to go.
   <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-2926aa8a-9a27-459b-ab59-d05506c9909d"> <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-bfd4d139-1ecf-4530-b3fe-31ba5a626cf9"> <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
@@ -178,7 +178,7 @@ Your system is all ready to go.
     <span class="p">}</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-ed3ca737-cc47-40c9-9779-7087f3ff3097"> <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-c6773d4a-3caa-4b35-9f93-17cbf51bb7c2"> <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
@@ -213,7 +213,7 @@ Your system is all ready to go.
     <span class="o">.</span><span class="na">property</span><span 
class="o">(</span><span class="s">"referrerId"</span><span class="o">,</span> 
<span class="s">"&lt;REFERRER ID&gt;"</span><span class="o">)</span>
     <span class="o">.</span><span class="na">property</span><span 
class="o">(</span><span class="s">"browser"</span><span class="o">,</span> 
<span class="s">"&lt;BROWSER&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">viewEvent</span><span class="o">);</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>In the same browing 
session &quot;akdj230fj8ass&quot;, the user with ID u0 buys an item i0 on time 
<code>2014-11-02T09:42:00.123-08:00</code> (current time will be used if 
eventTime is not specified), you can send the following buy event. Run the 
following <code>curl</code> command:</p><div class="tabs"> <ul class="control"> 
<li data-lang="json"><a href="#tab-3576dd88-4b1a-4dcb-ba77-5b4e7834b706">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-f89a91ab-27b7-43f9-b6f6-bc8180dc2bd6">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-d8d0e884-fa78-4404-9fd4-54d184cc3cdf">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-90cc35b6-4c9d-4218-93e3-63c84ec9a787">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-f5656c69-4af8-4b46-9e31-38ee23011c90">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-3576dd88-4b1a-4dcb-ba77-5b4e7834b706"> <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>In the same browing 
session &quot;akdj230fj8ass&quot;, the user with ID u0 buys an item i0 on time 
<code>2014-11-02T09:42:00.123-08:00</code> (current time will be used if 
eventTime is not specified), you can send the following buy event. Run the 
following <code>curl</code> command:</p><div class="tabs"> <ul class="control"> 
<li data-lang="json"><a href="#tab-caa35fd5-a20a-4658-8092-b45a42a52412">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-ee985cd9-91ba-48fe-920c-2c74c9149729">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-fe4fc034-44a7-490a-912d-d86947a589a2">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-390ce32e-01b8-428e-959b-812cb341a993">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-3d53fc03-6665-4b00-934b-f4678c4c4090">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-caa35fd5-a20a-4658-8092-b45a42a52412"> <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
@@ -238,7 +238,7 @@ Your system is all ready to go.
   }
   "eventTime" : "2014-11-02T09:42:00.123-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-f89a91ab-27b7-43f9-b6f6-bc8180dc2bd6"> <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-ee985cd9-91ba-48fe-920c-2c74c9149729"> <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
@@ -261,7 +261,7 @@ Your system is all ready to go.
     <span class="s">"sessionId"</span><span class="p">:</span> <span 
class="o">&lt;</span><span class="n">SESSION</span> <span 
class="n">ID</span><span class="o">&gt;</span><span class="p">,</span> <span 
class="c"># required</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-d8d0e884-fa78-4404-9fd4-54d184cc3cdf"> <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-fe4fc034-44a7-490a-912d-d86947a589a2"> <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
@@ -288,7 +288,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-90cc35b6-4c9d-4218-93e3-63c84ec9a787"> <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-390ce32e-01b8-428e-959b-812cb341a993"> <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
@@ -311,7 +311,7 @@ Your system is all ready to go.
     <span class="p">}</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-f5656c69-4af8-4b46-9e31-38ee23011c90"> <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-3d53fc03-6665-4b00-934b-f4678c4c4090"> <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
@@ -371,7 +371,7 @@ User u5 buys item i5
 </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 the 
results. When a user lands on your page &quot;example.com/page9&quot;, with 
referrer &quot;referrer10.com&quot; and browser &quot;Firefox&quot;, you can 
get the predicted lead score by sending this JSON &#39;{ 
&quot;landingPageId&quot; : &quot;example.com/page9&quot;, 
&quot;referrerId&quot; : &quot;referrer10.com&quot;, &quot;browser&quot;: 
&quot;Firefox&quot; }&#39; to the deployed engine. The engine will return a 
JSON with the score.</p><p>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 
terminal 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-726baae3-8699-4b4d-9677-06ac532bc864">REST API</a></li> <li 
data-lang="python"><a href="#tab-9de63788-cf82-4b1d-8358-96a4ef9ec4ae">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-9bd43286-4546-44ba-acf5-d920a90d46b6">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-00a45111-becb-4313-ae69-72c118dfa7ea">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-452d632c-c0a8-4c17-b42f-bbc6937535cd">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-726baae3-8699-4b4d-9677-06ac532bc864"> <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 the 
results. When a user lands on your page &quot;example.com/page9&quot;, with 
referrer &quot;referrer10.com&quot; and browser &quot;Firefox&quot;, you can 
get the predicted lead score by sending this JSON &#39;{ 
&quot;landingPageId&quot; : &quot;example.com/page9&quot;, 
&quot;referrerId&quot; : &quot;referrer10.com&quot;, &quot;browser&quot;: 
&quot;Firefox&quot; }&#39; to the deployed engine. The engine will return a 
JSON with the score.</p><p>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 
terminal 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-08664a94-0561-4c71-8119-fd73e17385c2">REST API</a></li> <li 
data-lang="python"><a href="#tab-de00a2d0-3350-496e-898f-4efe67fd5f9e">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-c87f5ed1-65b4-4981-9a9c-54a951a3e790">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-b0c3421b-3936-49dc-a9b5-30752499e8d7">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-688ed3d6-3e8e-47a6-8092-ba620eced4b0">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-08664a94-0561-4c71-8119-fd73e17385c2"> <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
@@ -384,7 +384,7 @@ User u5 buys item i5
   "browser": "Firefox" }'</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-9de63788-cf82-4b1d-8358-96a4ef9ec4ae"> <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-de00a2d0-3350-496e-898f-4efe67fd5f9e"> <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
@@ -397,7 +397,7 @@ http://localhost:8000/queries.json
   <span class="s">"referrerId"</span> <span class="p">:</span> <span 
class="s">"referrer10.com"</span><span class="p">,</span>
   <span class="s">"browser"</span><span class="p">:</span> <span 
class="s">"Firefox"</span>
 <span class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-9bd43286-4546-44ba-acf5-d920a90d46b6"> <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-c87f5ed1-65b4-4981-9a9c-54a951a3e790"> <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
@@ -426,7 +426,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-00a45111-becb-4313-ae69-72c118dfa7ea"> <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-b0c3421b-3936-49dc-a9b5-30752499e8d7"> <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
@@ -447,7 +447,7 @@ http://localhost:8000/queries.json
 <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-452d632c-c0a8-4c17-b42f-bbc6937535cd"> <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-688ed3d6-3e8e-47a6-8092-ba620eced4b0"> <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