Documentation based on apache/predictionio#d2c9f8f2a5bda3fdff1feb36ba7e8a445c5c702f
Project: http://git-wip-us.apache.org/repos/asf/predictionio-site/repo Commit: http://git-wip-us.apache.org/repos/asf/predictionio-site/commit/e6af2ef8 Tree: http://git-wip-us.apache.org/repos/asf/predictionio-site/tree/e6af2ef8 Diff: http://git-wip-us.apache.org/repos/asf/predictionio-site/diff/e6af2ef8 Branch: refs/heads/asf-site Commit: e6af2ef87cb19ddf54272c27a9c78afdea507373 Parents: 721427d Author: jenkins <bui...@apache.org> Authored: Fri Sep 14 19:37:31 2018 +0000 Committer: jenkins <bui...@apache.org> Committed: Fri Sep 14 19:37:31 2018 +0000 ---------------------------------------------------------------------- datacollection/batchimport/index.html | 4 +- datacollection/channel/index.html | 6 +- datacollection/eventapi/index.html | 20 +- gallery/template-gallery/index.html | 2 +- samples/tabs/index.html | 18 +- sdk/php/index.html | 2 +- sitemap.xml | 260 +++++++++---------- templates/classification/quickstart/index.html | 30 +-- .../complementarypurchase/quickstart/index.html | 20 +- .../quickstart/index.html | 60 ++--- .../quickstart/index.html | 60 ++--- templates/leadscoring/quickstart/index.html | 30 +-- templates/productranking/quickstart/index.html | 40 +-- templates/recommendation/quickstart/index.html | 30 +-- templates/similarproduct/quickstart/index.html | 40 +-- templates/vanilla/quickstart/index.html | 10 +- 16 files changed, 316 insertions(+), 316 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/e6af2ef8/datacollection/batchimport/index.html ---------------------------------------------------------------------- diff --git a/datacollection/batchimport/index.html b/datacollection/batchimport/index.html index cf41853..893fae9 100644 --- a/datacollection/batchimport/index.html +++ b/datacollection/batchimport/index.html @@ -7,7 +7,7 @@ </span><span class="p">{</span><span class="s2">"event"</span><span class="p">:</span><span class="s2">"rate"</span><span class="p">,</span><span class="s2">"entityType"</span><span class="p">:</span><span class="s2">"user"</span><span class="p">,</span><span class="s2">"entityId"</span><span class="p">:</span><span class="s2">"3"</span><span class="p">,</span><span class="s2">"targetEntityType"</span><span class="p">:</span><span class="s2">"item"</span><span class="p">,</span><span class="s2">"targetEntityId"</span><span class="p">:</span><span class="s2">"2"</span><span class="p">,</span><span class="s2">"properties"</span><span class="p">:{</span><span class="s2">"rating"</span><span class="p">:</span><span class="mf">1.0</span><span class="p">},</span><span class="s2">"eventTime"</span><span class="p">:</span><span class="s2">"2014-11-21T01:04:14.729Z"</span><span class="p">}</span><span class="w"> </span><span class="p">{</span><span class="s2">"event"</span><span class="p">:</span><span class="s2">"buy"</span><span class="p">,</span><span class="s2">"entityType"</span><span class="p">:</span><span class="s2">"user"</span><span class="p">,</span><span class="s2">"entityId"</span><span class="p">:</span><span class="s2">"3"</span><span class="p">,</span><span class="s2">"targetEntityType"</span><span class="p">:</span><span class="s2">"item"</span><span class="p">,</span><span class="s2">"targetEntityId"</span><span class="p">:</span><span class="s2">"7"</span><span class="p">,</span><span class="s2">"eventTime"</span><span class="p">:</span><span class="s2">"2014-11-21T01:04:14.735Z"</span><span class="p">}</span><span class="w"> </span><span class="p">{</span><span class="s2">"event"</span><span class="p">:</span><span class="s2">"buy"</span><span class="p">,</span><span class="s2">"entityType"</span><span class="p">:</span><span class="s2">"user"</span><span class="p">,</span><span class="s2">"entityId"</span><span class="p">:</span><span class="s2">"3"</span><span class="p">,</span><span class="s2">"targetEntityType"</span><span class="p">:</span><span class="s2">"item"</span><span class="p">,</span><span class="s2">"targetEntityId"</span><span class="p">:</span><span class="s2">"8"</span><span class="p">,</span><span class="s2">"eventTime"</span><span class="p">:</span><span class="s2">"2014-11-21T01:04:14.741Z"</span><span class="p">}</span><span class="w"> -</span></pre></td></tr></tbody></table> </div> <div class="alert-message warning"><p>Please make sure your import file does not contain any empty lines. Empty lines will be treated as a null object and will return an error during import.</p></div><h2 id='use-sdk-to-prepare-batch-input-file' class='header-anchors'>Use SDK to Prepare Batch Input File</h2><p>Some of the Apache PredictionIO SDKs also provides FileExporter client. You may use them to prepare the JSON file as described above. The FileExporter creates event in the same way as EventClient except that the events are written to a JSON file instead of being sent to EventSever. The written JSON file can then be used by batch import.</p><div class="tabs"> <ul class="control"> <li data-lang="php"><a href="#tab-2d422a2d-411b-4336-9244-6c5c632a2ef5">PHP SDK</a></li> <li data-lang="python"><a href="#tab-50b7819f-36cd-4150-a67a-200409c8a0d7">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-3a1563b3-b178-4a1c-98db-56024e4853f8"> Ruby SDK</a></li> <li data-lang="java"><a href="#tab-bf92f28f-cc26-4e54-b000-0888f1322de5">Java SDK</a></li> </ul> <div data-tab="PHP SDK" data-lang="php" id="tab-2d422a2d-411b-4336-9244-6c5c632a2ef5"> (coming soon) </div> <div data-tab="Python SDK" data-lang="python" id="tab-50b7819f-36cd-4150-a67a-200409c8a0d7"> <div class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1 +</span></pre></td></tr></tbody></table> </div> <div class="alert-message warning"><p>Please make sure your import file does not contain any empty lines. Empty lines will be treated as a null object and will return an error during import.</p></div><h2 id='use-sdk-to-prepare-batch-input-file' class='header-anchors'>Use SDK to Prepare Batch Input File</h2><p>Some of the Apache PredictionIO SDKs also provides FileExporter client. You may use them to prepare the JSON file as described above. The FileExporter creates event in the same way as EventClient except that the events are written to a JSON file instead of being sent to EventSever. The written JSON file can then be used by batch import.</p><div class="tabs"> <ul class="control"> <li data-lang="php"><a href="#tab-3291d5df-1d84-47f4-9c55-15b0e2f22434">PHP SDK</a></li> <li data-lang="python"><a href="#tab-8e6deb75-3e01-4db2-9dfb-b2e064bc3676">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-b342fc9f-6461-4a96-bb8b-8110d379ad8f"> Ruby SDK</a></li> <li data-lang="java"><a href="#tab-523d13bf-d972-4a10-933b-92b3c784c9a1">Java SDK</a></li> </ul> <div data-tab="PHP SDK" data-lang="php" id="tab-3291d5df-1d84-47f4-9c55-15b0e2f22434"> (coming soon) </div> <div data-tab="Python SDK" data-lang="python" id="tab-8e6deb75-3e01-4db2-9dfb-b2e064bc3676"> <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 @@ -58,7 +58,7 @@ <span class="c"># close the FileExporter when finish writing all events</span> <span class="n">exporter</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> -</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-3a1563b3-b178-4a1c-98db-56024e4853f8"> (coming soon) </div> <div data-tab="Java SDK" data-lang="java" id="tab-bf92f28f-cc26-4e54-b000-0888f1322de5"> <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> <td class="code"><pre><span class="o">(</span><span class="n">coming</span> <span class="n">soon</span><span class="o">)</span> +</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-b342fc9f-6461-4a96-bb8b-8110d379ad8f"> (coming soon) </div> <div data-tab="Java SDK" data-lang="java" id="tab-523d13bf-d972-4a10-933b-92b3c784c9a1"> <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> <td class="code"><pre><span class="o">(</span><span class="n">coming</span> <span class="n">soon</span><span class="o">)</span> </pre></td> </tr></tbody></table> </div> </div> </div> <h2 id='import-events-from-input-file' class='header-anchors'>Import Events from Input File</h2><p>Importing events from a file can be done easily using the command line interface. Assuming that <code>pio</code> be in your search path, your App ID be <code>123</code>, and the input file <code>my_events.json</code> be in your current working directory:</p><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><td class="code"><pre><span class="gp">$ </span>pio import --appid 123 --input my_events.json </pre></td></tr></tbody></table> </div> <p>After a brief while, the tool should return to the console without any error. Congratulations! You have successfully imported your events.</p></div></div></div></div><footer><div class="container"><div class="seperator"></div><div class="row"><div class="col-md-6 footer-link-column"><div class="footer-link-column-row"><h4>Community</h4><ul><li><a href="//predictionio.apache.org/install/" target="blank">Download</a></li><li><a href="//predictionio.apache.org/" target="blank">Docs</a></li><li><a href="//github.com/apache/predictionio" target="blank">GitHub</a></li><li><a href="mailto:user-subscr...@predictionio.apache.org" target="blank">Subscribe to User Mailing List</a></li><li><a href="//stackoverflow.com/questions/tagged/predictionio" target="blank">Stackoverflow</a></li></ul></div></div><div class="col-md-6 footer-link-column"><div class="footer-link-column-row"><h4>Contribute</h4><ul><li><a href="//predictionio.apache.org/community/cont ribute-code/" target="blank">Contribute</a></li><li><a href="//github.com/apache/predictionio" target="blank">Source Code</a></li><li><a href="//issues.apache.org/jira/browse/PIO" target="blank">Bug Tracker</a></li><li><a href="mailto:dev-subscr...@predictionio.apache.org" target="blank">Subscribe to Development Mailing List</a></li></ul></div></div></div><div class="row"><div class="col-md-12 footer-link-column"><p>Apache PredictionIO, PredictionIO, Apache, the Apache feather logo, and the Apache PredictionIO project logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries.</p><p>All other marks mentioned may be trademarks or registered trademarks of their respective owners.</p></div></div></div><div id="footer-bottom"><div class="container"><div class="row"><div class="col-md-12"><div id="footer-logo-wrapper"><img alt="PredictionIO" src="/images/logos/logo-white-d1e9c6e6.png"/><span>®</span></div><div id="socia l-icons-wrapper"><a class="github-button" href="https://github.com/apache/predictionio" data-icon="octicon-star" data-show-count="true" aria-label="Star apache/predictionio on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/predictionio/fork" data-icon="octicon-repo-forked" data-show-count="true" aria-label="Fork apache/predictionio on GitHub">Fork</a> <script id="github-bjs" async="" defer="" src="https://buttons.github.io/buttons.js"></script><a href="https://twitter.com/predictionio" target="blank"><img alt="PredictionIO on Twitter" src="/images/icons/twitter-ea9dc152.png"/></a> <a href="https://www.facebook.com/predictionio" target="blank"><img alt="PredictionIO on Facebook" src="/images/icons/facebook-5c57939c.png"/></a> </div></div></div></div></div></footer></div><script>(function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){ (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t); http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/e6af2ef8/datacollection/channel/index.html ---------------------------------------------------------------------- diff --git a/datacollection/channel/index.html b/datacollection/channel/index.html index 6e1f7fb..706ea16 100644 --- a/datacollection/channel/index.html +++ b/datacollection/channel/index.html @@ -12,7 +12,7 @@ [INFO] [App$] Channel Name: myChannel [INFO] [App$] Channel ID: 2 [INFO] [App$] App ID: 5 -</span></pre></td></tr></tbody></table> </div> <p>Now "myChannel" is created and ready for collecting data.</p><h2 id='collect-data-through-channel' class='header-anchors'>Collect data through Channel</h2><p>The Event API support optional <code>channel</code> query parameter. This allows you to import and query events of the specified channel. When the <code>channel</code> parameter is not specified, the data is collected through the default channel.</p><p>URL: <code>http://localhost:7070/events.json?accessKey=yourAccessKeyString&channel=yourChannelName</code></p><p>Query parameters:</p> <table><thead> <tr> <th style="text-align: left">Field</th> <th style="text-align: left">Type</th> <th style="text-align: left">Description</th> </tr> </thead><tbody> <tr> <td style="text-align: left"><code>accessKey</code></td> <td style="text-align: left">String</td> <td style="text-align: left">The Access Key for your App</td> </tr> <tr> <td style="text-align: left"><code>channel</c ode></td> <td style="text-align: left">String</td> <td style="text-align: left">The channel name (optional). Specify this to import data to this channel. <strong>NOTE: supported in PIO version >= 0.9.2</strong> only. Channel must be created first.</td> </tr> </tbody></table> <p>For SDK usage, one EventClient should be responsible for collecting data of one specific channel. The channel name is specified when the EventClient object is instantiated.</p><p>For example, the following code import event to "YOUR_CHANNEL" of the corresponding App.</p><div class="tabs"> <ul class="control"> <li data-lang="bash"><a href="#tab-06d64a7d-9ffb-46f0-8831-1f87d36c2de1">Raw HTTP</a></li> <li data-lang="php"><a href="#tab-219973a8-95df-4adf-bf70-b0909724866e">PHP SDK</a></li> <li data-lang="python"><a href="#tab-1b3fe4b2-3eeb-414c-b01d-1f97cacdcdef">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-c174b596-a9ce-4fb9-a58e-f990d540850b">Ruby SDK</a></li> <li data-lang="java"><a href ="#tab-930fad28-e7c5-4fb0-a758-b69ca11c46dd">Java SDK</a></li> </ul> <div data-tab="Raw HTTP" data-lang="bash" id="tab-06d64a7d-9ffb-46f0-8831-1f87d36c2de1"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1 +</span></pre></td></tr></tbody></table> </div> <p>Now "myChannel" is created and ready for collecting data.</p><h2 id='collect-data-through-channel' class='header-anchors'>Collect data through Channel</h2><p>The Event API support optional <code>channel</code> query parameter. This allows you to import and query events of the specified channel. When the <code>channel</code> parameter is not specified, the data is collected through the default channel.</p><p>URL: <code>http://localhost:7070/events.json?accessKey=yourAccessKeyString&channel=yourChannelName</code></p><p>Query parameters:</p> <table><thead> <tr> <th style="text-align: left">Field</th> <th style="text-align: left">Type</th> <th style="text-align: left">Description</th> </tr> </thead><tbody> <tr> <td style="text-align: left"><code>accessKey</code></td> <td style="text-align: left">String</td> <td style="text-align: left">The Access Key for your App</td> </tr> <tr> <td style="text-align: left"><code>channel</c ode></td> <td style="text-align: left">String</td> <td style="text-align: left">The channel name (optional). Specify this to import data to this channel. <strong>NOTE: supported in PIO version >= 0.9.2</strong> only. Channel must be created first.</td> </tr> </tbody></table> <p>For SDK usage, one EventClient should be responsible for collecting data of one specific channel. The channel name is specified when the EventClient object is instantiated.</p><p>For example, the following code import event to "YOUR_CHANNEL" of the corresponding App.</p><div class="tabs"> <ul class="control"> <li data-lang="bash"><a href="#tab-d0d56efa-1b7a-44e4-88b8-27ca0bb846df">Raw HTTP</a></li> <li data-lang="php"><a href="#tab-00dc3e1f-c1a8-488f-aa4e-bce3da8e5cfa">PHP SDK</a></li> <li data-lang="python"><a href="#tab-126b185d-a438-4a20-b36b-f61e25273431">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-d83df097-3263-4789-8168-84bc1de9a301">Ruby SDK</a></li> <li data-lang="java"><a href ="#tab-6f827243-541c-404c-a680-6cf56252c7eb">Java SDK</a></li> </ul> <div data-tab="Raw HTTP" data-lang="bash" id="tab-d0d56efa-1b7a-44e4-88b8-27ca0bb846df"> <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 @@ -39,7 +39,7 @@ }, "eventTime" : "2004-12-13T21:39:45.618Z" }'</span> -</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-219973a8-95df-4adf-bf70-b0909724866e"> (TODO: update me) </div> <div data-tab="Python SDK" data-lang="python" id="tab-1b3fe4b2-3eeb-414c-b01d-1f97cacdcdef"> <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="PHP SDK" data-lang="php" id="tab-00dc3e1f-c1a8-488f-aa4e-bce3da8e5cfa"> (TODO: update me) </div> <div data-tab="Python SDK" data-lang="python" id="tab-126b185d-a438-4a20-b36b-f61e25273431"> <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 @@ -80,7 +80,7 @@ <span class="n">properties</span><span class="o">=</span><span class="n">event_properties</span><span class="p">,</span> <span class="n">event_time</span><span class="o">=</span><span class="n">datetime</span><span class="p">(</span><span class="mi">2014</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="mi">13</span><span class="p">,</span> <span class="mi">21</span><span class="p">,</span> <span class="mi">38</span><span class="p">,</span> <span class="mi">45</span><span class="p">,</span> <span class="mi">618000</span><span class="p">,</span> <span class="n">pytz</span><span class="o">.</span><span class="n">utc</span><span class="p">))</span> -</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-c174b596-a9ce-4fb9-a58e-f990d540850b"> (TODO: update me) </div> <div data-tab="Java SDK" data-lang="java" id="tab-930fad28-e7c5-4fb0-a758-b69ca11c46dd"> <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> <td class="code"><pre><span class="o">(</span><span class="n">coming</span> <span class="n">soon</span><span class="o">)</span> +</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-d83df097-3263-4789-8168-84bc1de9a301"> (TODO: update me) </div> <div data-tab="Java SDK" data-lang="java" id="tab-6f827243-541c-404c-a680-6cf56252c7eb"> <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> <td class="code"><pre><span class="o">(</span><span class="n">coming</span> <span class="n">soon</span><span class="o">)</span> </pre></td> </tr></tbody></table> </div> </div> </div> <p>You can also follow the EventAPI <a href="/datacollection/eventapi/#debugging-recipes">debug receipts</a> to query the events of specific channel by adding the <code>channel</code> query parameter in the URL.</p><h2 id='delete-a-channel-(including-all-imported-data)' class='header-anchors'>Delete a Channel (including all imported data)</h2><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><td class="code"><pre>pio app channel-delete <app name> <channel name> </pre></td></tr></tbody></table> </div> <h2 id='delete-the-data-only-of-a-channel' class='header-anchors'>Delete the data-only of a Channel</h2><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><td class="code"><pre>pio app data-delete <app name> --channel <channel name> </pre></td></tr></tbody></table> </div> <h2 id='accessing-channel-data-in-engine' class='header-anchors'>Accessing Channel Data in Engine</h2><p>To acccess channel data, simply specify the channel name when use the PEventStore or LEventStore API. Data is read from from the default channel if channelName is not specified.</p><p>For example, read data from default channel:</p><div class="highlight scala"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1 http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/e6af2ef8/datacollection/eventapi/index.html ---------------------------------------------------------------------- diff --git a/datacollection/eventapi/index.html b/datacollection/eventapi/index.html index 4b571a0..2610687 100644 --- a/datacollection/eventapi/index.html +++ b/datacollection/eventapi/index.html @@ -22,7 +22,7 @@ Content-Length: 18 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span> Name: MyTestApp <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span> ID: 6 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span> Access Key: WPgcXKd42FPQpZHVbVeMyqF4CQJUnXQmIMTHhX3ZUrSzvy1KXJjdFUrslifa9rnB -</pre></td></tr></tbody></table> </div> <h3 id='creating-your-first-event' class='header-anchors'>Creating Your First Event</h3><p>You may connect to the Event Server with HTTP request or by using one of many <strong>Apache PredictionIO SDKs</strong>.</p><p>For example, the following shows how one can create an event involving a single entity. Replace the value of <code>accessKey</code> by the <em>Access Key</em> generated for your App.</p><div class="tabs"> <ul class="control"> <li data-lang="bash"><a href="#tab-bb11b4ef-7ed0-4330-a7a9-a9e54d4307a7">Raw HTTP</a></li> <li data-lang="php"><a href="#tab-c7b67a71-f62c-44c8-a673-43985669b407">PHP SDK</a></li> <li data-lang="python"><a href="#tab-d75571d0-a3a2-4747-a369-84cbdfc5d45e">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-831a12fe-ff5f-4e33-b8c2-311d92a26e1b">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-be3ceb00-6b6d-4061-8aa4-1dda4766089a">Java SDK</a></li> </ul> <div data-tab="Raw HTTP" data-lang="bash" id="tab- bb11b4ef-7ed0-4330-a7a9-a9e54d4307a7"> <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> <h3 id='creating-your-first-event' class='header-anchors'>Creating Your First Event</h3><p>You may connect to the Event Server with HTTP request or by using one of many <strong>Apache PredictionIO SDKs</strong>.</p><p>For example, the following shows how one can create an event involving a single entity. Replace the value of <code>accessKey</code> by the <em>Access Key</em> generated for your App.</p><div class="tabs"> <ul class="control"> <li data-lang="bash"><a href="#tab-f6be1b6d-4ee8-4995-8666-35e0c344cd27">Raw HTTP</a></li> <li data-lang="php"><a href="#tab-e7992f14-9f49-44cc-a88c-471a329eccb1">PHP SDK</a></li> <li data-lang="python"><a href="#tab-a79ede29-debd-486a-93c7-32100499c1aa">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-6044762f-8994-49e4-b286-17b14b64aa32">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-0a66a665-e234-4100-94b8-ce1aaf09b8e1">Java SDK</a></li> </ul> <div data-tab="Raw HTTP" data-lang="bash" id="tab- f6be1b6d-4ee8-4995-8666-35e0c344cd27"> <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 @@ -53,7 +53,7 @@ Content-Length: 18 } "eventTime" : "2004-12-13T21:39:45.618-07:00" }'</span> -</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-c7b67a71-f62c-44c8-a673-43985669b407"> <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-e7992f14-9f49-44cc-a88c-471a329eccb1"> <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 @@ -94,7 +94,7 @@ Content-Length: 18 <span class="s1">'eventTime'</span> <span class="o">=></span> <span class="s1">'2004-12-13T21:39:45.618-07:00'</span> <span class="p">));</span> <span class="cp">?></span> -</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-d75571d0-a3a2-4747-a369-84cbdfc5d45e"> <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-a79ede29-debd-486a-93c7-32100499c1aa"> <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 @@ -137,7 +137,7 @@ Content-Length: 18 <span class="n">properties</span><span class="o">=</span><span class="n">first_event_properties</span><span class="p">,</span> <span class="n">event_time</span><span class="o">=</span><span class="n">first_event_time</span><span class="p">,</span> <span class="p">)</span> -</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-831a12fe-ff5f-4e33-b8c2-311d92a26e1b"> <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-6044762f-8994-49e4-b286-17b14b64aa32"> <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 @@ -158,8 +158,8 @@ Content-Length: 18 <span class="s1">'prop4'</span> <span class="o">=></span> <span class="kp">true</span><span class="p">,</span> <span class="s1">'prop5'</span> <span class="o">=></span> <span class="sx">%w(a b c)</span><span class="p">,</span> <span class="s1">'prop6'</span> <span class="o">=></span> <span class="mi">4</span><span class="o">.</span><span class="mi">56</span> <span class="p">})</span> -</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-be3ceb00-6b6d-4061-8aa4-1dda4766089a"> <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> <td class="code"><pre><span class="o">(</span><span class="n">coming</span> <span class="n">soon</span><span class="o">)</span> -</pre></td> </tr></tbody></table> </div> </div> </div> <p>For example, the following shows how one can create an event involving two entities (with <code>targetEntity</code>).</p><div class="tabs"> <ul class="control"> <li data-lang="bash"><a href="#tab-fdae8ec2-cc77-489e-933d-56ba005726d5">Raw HTTP</a></li> <li data-lang="php"><a href="#tab-b78045ad-4b92-4474-8d75-678a614eab92">PHP SDK</a></li> <li data-lang="python"><a href="#tab-c87d2b25-6070-47f7-9dec-48979cce6444">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-799c7c11-c518-4c5f-8523-d91d5e5a2534">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-c5979450-161f-468d-815f-118d98368642">Java SDK</a></li> </ul> <div data-tab="Raw HTTP" data-lang="bash" id="tab-fdae8ec2-cc77-489e-933d-56ba005726d5"> <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 data-tab="Java SDK" data-lang="java" id="tab-0a66a665-e234-4100-94b8-ce1aaf09b8e1"> <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> <td class="code"><pre><span class="o">(</span><span class="n">coming</span> <span class="n">soon</span><span class="o">)</span> +</pre></td> </tr></tbody></table> </div> </div> </div> <p>For example, the following shows how one can create an event involving two entities (with <code>targetEntity</code>).</p><div class="tabs"> <ul class="control"> <li data-lang="bash"><a href="#tab-e157a999-807f-49bc-8e0f-d9a6a1be99f2">Raw HTTP</a></li> <li data-lang="php"><a href="#tab-7adb7215-8b7e-4391-9e55-0ba22f59dd4c">PHP SDK</a></li> <li data-lang="python"><a href="#tab-c010a5c3-3b9a-47f6-bd46-ec7d160c630e">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-bb7021b0-af3a-452a-bb99-2e33e59eaf86">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-5c0e84a4-5679-4005-891b-48721abda2da">Java SDK</a></li> </ul> <div data-tab="Raw HTTP" data-lang="bash" id="tab-e157a999-807f-49bc-8e0f-d9a6a1be99f2"> <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 @@ -186,7 +186,7 @@ Content-Length: 18 }, "eventTime" : "2004-12-13T21:39:45.618Z" }'</span> -</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-b78045ad-4b92-4474-8d75-678a614eab92"> <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-7adb7215-8b7e-4391-9e55-0ba22f59dd4c"> <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 @@ -221,7 +221,7 @@ Content-Length: 18 <span class="s1">'eventTime'</span> <span class="o">=></span> <span class="s1">'2004-12-13T21:39:45.618Z'</span> <span class="p">));</span> <span class="cp">?></span> -</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-c87d2b25-6070-47f7-9dec-48979cce6444"> <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-c010a5c3-3b9a-47f6-bd46-ec7d160c630e"> <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 @@ -246,7 +246,7 @@ Content-Length: 18 <span class="n">target_entity_id</span><span class="o">=</span><span class="s">"iid"</span><span class="p">,</span> <span class="n">properties</span><span class="o">=</span><span class="n">second_event_properties</span><span class="p">,</span> <span class="n">event_time</span><span class="o">=</span><span class="n">datetime</span><span class="p">(</span><span class="mi">2014</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="mi">13</span><span class="p">,</span> <span class="mi">21</span><span class="p">,</span> <span class="mi">38</span><span class="p">,</span> <span class="mi">45</span><span class="p">,</span> <span class="mi">618000</span><span class="p">,</span> <span class="n">pytz</span><span class="o">.</span><span class="n">utc</span><span class="p">))</span> -</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-799c7c11-c518-4c5f-8523-d91d5e5a2534"> <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-bb7021b0-af3a-452a-bb99-2e33e59eaf86"> <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 @@ -263,7 +263,7 @@ Content-Length: 18 <span class="s1">'eventTime'</span> <span class="o">=></span> <span class="s1">'2004-12-13T21:39:45.618Z'</span><span class="p">,</span> <span class="s1">'properties'</span> <span class="o">=></span> <span class="p">{</span> <span class="s1">'someProperty'</span> <span class="o">=></span> <span class="s1">'value1'</span><span class="p">,</span> <span class="s1">'anotherProperty'</span> <span class="o">=></span> <span class="s1">'value2'</span> <span class="p">})</span> -</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-c5979450-161f-468d-815f-118d98368642"> <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> <td class="code"><pre><span class="o">(</span><span class="n">coming</span> <span class="n">soon</span><span class="o">)</span> +</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-5c0e84a4-5679-4005-891b-48721abda2da"> <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> <td class="code"><pre><span class="o">(</span><span class="n">coming</span> <span class="n">soon</span><span class="o">)</span> </pre></td> </tr></tbody></table> </div> </div> </div> <p>Sample response:</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 3