http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/ea42f27e/templates/javaecommercerecommendation/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/javaecommercerecommendation/quickstart/index.html 
b/templates/javaecommercerecommendation/quickstart/index.html
index 0a5ba34..2fc296f 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-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
+</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-ba46f6db-f20a-4a3b-a9d3-63df0c4dc1a1">REST API</a></li> <li 
data-lang="python"><a href="#tab-b3c7d9ed-ed04-4022-98e1-92cae0614243">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-589f3a11-a9ac-4748-8dd1-e7dc6b4953a0">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-31cbbd95-486f-4650-9334-23f70dd9792f">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-96ae99bb-3dcf-4adb-8c3a-03f90d6516cd">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-ba46f6db-f20a-4a3b-a9d3-63df0c4dc1a1"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-b3c7d9ed-ed04-4022-98e1-92cae0614243"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-589f3a11-a9ac-4748-8dd1-e7dc6b4953a0"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-31cbbd95-486f-4650-9334-23f70dd9792f"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-96ae99bb-3dcf-4adb-8c3a-03f90d6516cd"> <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-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
+</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-02940adb-1e90-4a13-97bc-2a85730cd51d">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-e61c7424-19a0-4727-9237-2b124fe81805">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-451e5981-e00f-4dd8-a172-9d814159dec4">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-110a421f-0ad1-4dab-8676-09e8d29e3e47">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-663bb4a8-27e4-4be5-9170-801c459e002e">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-02940a
 db-1e90-4a13-97bc-2a85730cd51d"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-e61c7424-19a0-4727-9237-2b124fe81805"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-451e5981-e00f-4dd8-a172-9d814159dec4"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-110a421f-0ad1-4dab-8676-09e8d29e3e47"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-663bb4a8-27e4-4be5-9170-801c459e002e"> <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-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
+</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-e71c18a1-53b6-46c5-b085-d553e63e026a">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-24880c9c-6421-4042-88bd-295f371761cc">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-e9d2e144-d65b-4f23-b13d-3f5df71937f6">PHP 
SDK</a></li> <li data-lang="ruby"><a href="#tab-8796b71f-a625-4272-89fe-29dcd9
 87e995">Ruby SDK</a></li> <li data-lang="java"><a 
href="#tab-86a9331b-832b-4f52-bcc0-b21867b09b77">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-e71c18a1-53b6-46c5-b085-d553e63e026a"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-24880c9c-6421-4042-88bd-295f371761cc"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-e9d2e144-d65b-4f23-b13d-3f5df71937f6"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-8796b71f-a625-4272-89fe-29dcd987e995"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-86a9331b-832b-4f52-bcc0-b21867b09b77"> <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-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
+</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-3895ea4f-c696-4d8f-bdc1-e2aacb24b01c">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-d3bfa412-b8d0-49af-a7f8-d03940330da6">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-896af9b7-e3fa-4c8a-8f76-d5c76b864227">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-9cfc880f-c6ea-442b-b910-fd8751385566">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-c720a57d-123a-4df6-8a7d-ecff431a8389">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-3895ea4f-c696-4d8f-bdc1-e2aacb24b01c"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-d3bfa412-b8d0-49af-a7f8-d03940330da6"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-896af9b7-e3fa-4c8a-8f76-d5c76b864227"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-9cfc880f-c6ea-442b-b910-fd8751385566"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-c720a57d-123a-4df6-8a7d-ecff431a8389"> <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-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
+</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-ce729b6a-79cd-4a34-b6d4-a28b33818f5b">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-89d53fd8-1f87-4698-85d3-7534d8e9d00e">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-2af7926b-3aa4-498c-9462-02f7697830a5">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-cd403631-5faf-4a61-952f-446582f67893">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-8935459c-9c5b-4d66-9438-357fd8f5dbcc">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-ce729b6a-79cd-4a34-b6d4-a28b33818f5b"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-89d53fd8-1f87-4698-85d3-7534d8e9d00e"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-2af7926b-3aa4-498c-9462-02f7697830a5"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-cd403631-5faf-4a61-952f-446582f67893"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-8935459c-9c5b-4d66-9438-357fd8f5dbcc"> <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-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
+</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-89a7f3aa-7331-4eea-9ecc-65c1f44ed7d9">REST API</a></li> <li 
data-lang="python"><a href="#tab-1325308f-7124-4d76-a1e8-830f8379923b">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-d8c7f49c-5d51-4865-a031-cfcd2738d7ee">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-f4b71453-efa4-4e55-8eed-f086c095d733">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-7819e73e-47d8-426e-8e8a-5e3f8351243e">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-89a7f3aa-7331-4eea-9ecc-65c1f44ed7d9"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-1325308f-7124-4d76-a1e8-830f8379923b"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-d8c7f49c-5d51-4865-a031-cfcd2738d7ee"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-f4b71453-efa4-4e55-8eed-f086c095d733"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-7819e73e-47d8-426e-8e8a-5e3f8351243e"> <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/ea42f27e/templates/leadscoring/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/leadscoring/quickstart/index.html 
b/templates/leadscoring/quickstart/index.html
index 70b34ae..5ae79bc 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-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
+</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-ef5f7ecb-dff6-45f6-
 8ed5-30ab39d32a9a">REST API</a></li> <li data-lang="python"><a 
href="#tab-7829a710-04dc-421e-bcb0-7b60e31d7256">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-a67cfef8-a83b-4b64-b454-bc72f8b90edd">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-69cee151-0c79-4db0-a79c-59b337d923b8">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-9831acf0-f413-4b3a-bab6-9422937524f5">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-ef5f7ecb-dff6-45f6-8ed5-30ab39d32a9a"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-7829a710-04dc-421e-bcb0-7b60e31d7256"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-a67cfef8-a83b-4b64-b454-bc72f8b90edd"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-69cee151-0c79-4db0-a79c-59b337d923b8"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-9831acf0-f413-4b3a-bab6-9422937524f5"> <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-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
+</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-522b8f55-0bfc-4acc-964f-a8fbdd816284">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-47801c76-3a53-4085-8364-a37ae651844f">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-6961b98b-d8ad-416f-a0d2-c638e916496d">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-c059e3b3-3fa7-4450-92c3-e24529671b87">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-88872f3f-2d64-49b7-bce3-6f20c05c8302">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-522b8f55-0bfc-4acc-964f-a8fbdd816284"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-47801c76-3a53-4085-8364-a37ae651844f"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-6961b98b-d8ad-416f-a0d2-c638e916496d"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-c059e3b3-3fa7-4450-92c3-e24529671b87"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-88872f3f-2d64-49b7-bce3-6f20c05c8302"> <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-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
+</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-d77c25b5-8be5-4662-b636-9624ffd88e33">REST API</a></li> <li 
data-lang="python"><a href="#tab-947c77ff-d930-4e61-b8ad-050313245225">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-1b860b04-e1fc-432d-9665-354c9a3ddfc3">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-5ff1ee5b-110d-4bf1-b0c7-8336cc72dcd4">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-d15ea609-b642-454b-8bc4-d4173096ef45">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-d77c25b5-8be5-4662-b636-9624ffd88e33"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-947c77ff-d930-4e61-b8ad-050313245225"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-1b860b04-e1fc-432d-9665-354c9a3ddfc3"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-5ff1ee5b-110d-4bf1-b0c7-8336cc72dcd4"> <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-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
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-d15ea609-b642-454b-8bc4-d4173096ef45"> <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