You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@predictionio.apache.org by gi...@apache.org on 2018/08/11 00:24:00 UTC

[01/11] predictionio-site git commit: Documentation based on apache/predictionio#54415e1066ae2d646eef62ebfdf801ace1de2097

Repository: predictionio-site
Updated Branches:
  refs/heads/asf-site 2e455bb8c -> c17b96077


http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/tryit/index.html
----------------------------------------------------------------------
diff --git a/tryit/index.html b/tryit/index.html
index 955ef4d..55559da 100644
--- a/tryit/index.html
+++ b/tryit/index.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><title>Try PredictionIO</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Try PredictionIO"/><link rel="canonical" href="https://predictionio.apache.org/tryit/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><script src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-
 AMS-MML_HTMLorMML"></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body class="tryit"><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="page" class="container"><main id="main" role="main" data-swiftype-index="true"><div id="content"><div class="codepicnic"><div class="tutorial"><div class="j
 carousel-wrapper"><ul class="jcarousel-pagination"></ul><div class="jcarousel"><ul><li><h2>Introduction</h2><p>To see how PredictionIO works, you can follow this quick tutorial to:</p><p>Start the PredictionIO server</p><p>Build, train, and deploy a predictive model with pre-imported data.</p><p>Query prediction results.</p><p><a class="button-primary" id="tryit-start" href="#">Start</a></p></li><li><h2>Start</h2><p>Start PredictionIO and it's dependancies with:</p><p><code>$ pio-start-all</code></p><h2>Check Status</h2><p>At any time you can run:</p><p><code>$ pio status</code></p><p>Which checks the status of PredictionIO and it's dependancies.</p></li><li><h2>Build</h2><p>All engine commands need to be run from within the engine directory:</p><p><code>$ cd ~/PredictionIO/MyEngine</code></p><p>Build the engine with:</p><p><code>$ pio build</code></p></li><li><h2>Train and Deploy</h2><h3>Train the engine</h3><p><a href="http://grouplens.org/datasets/movielens/">Sample data</a> is a
 lready imported, you can train the model the data by running:</p><p><code>$ pio train</code></p><h3>Deploy the trained engine</h3><p>Deploy the trained engine as a background process:</p><p><code>$ pio deploy &</code></p></li><li><h2>Querying Results</h2><p>You can query results using cURL with after you see "Ready to serve":</p><p><code>$ curl -H "Content-Type: application/json" -d '{ "items": ["296"], "num": 5 }' http://localhost:8000/queries.json</code></p><p>This will return 5 recomended movies for movie 296 (Pulp Fiction).</p></li><li><h2>Next Steps</h2><p><a href="http://predictionio.apache.org/install/">Install</a> PredictionIO on your own computer!</p><h3>Support</h3><p>Get support on our <a href="https://groups.google.com/forum/#!forum/predictionio-user">Google Group</a> or on Twitter <a href="https://twitter.com/predictionio/">@PredictionIO</a></p></li></ul><div class="jcarousel-controls"><a href="#" class="jcarousel-control-prev">&lsaquo; Prev</a><a href="#" class="jcarou
 sel-control-next">Next &rsaquo;</a></div></div></div></div><div class="iframe"><iframe src="https://codepicnic.com/bites/predictionio-0-9-1/embed?sidebar=closed&hostname=predictionio&hide=readme"></iframe></div></div></div></main></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-subscribe@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="//predictioni
 o.apache.org/community/contribute-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-subscribe@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="social-icons-wrapper"><a class="github-button" href="https://github.com/apache/predictionio" data-style="mega" data-count-href="/apache/predictionio/stargazers" data-count-api="/repos/apache/predictionio#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star apache/predictionio on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/predictionio/fork" data-icon="octicon-git-branch" data-style="mega" data-count-href="/apache/predictionio/network" data-count-api="/repos/apache/predictionio#forks_count" data-count-aria-label="# forks on GitHub" 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(){
+<!DOCTYPE html><html><head><title>Try PredictionIO</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Try PredictionIO"/><link rel="canonical" href="https://predictionio.apache.org/tryit/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><script src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-
 AMS-MML_HTMLorMML"></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body class="tryit"><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="page" class="container"><main id="main" role="main" data-swiftype-index="true"><div id="content"><div class="codepicnic"><div class="tutorial"><div class="j
 carousel-wrapper"><ul class="jcarousel-pagination"></ul><div class="jcarousel"><ul><li><h2>Introduction</h2><p>To see how PredictionIO works, you can follow this quick tutorial to:</p><p>Start the PredictionIO server</p><p>Build, train, and deploy a predictive model with pre-imported data.</p><p>Query prediction results.</p><p><a class="button-primary" id="tryit-start" href="#">Start</a></p></li><li><h2>Start</h2><p>Start PredictionIO and it's dependencies with:</p><p><code>$ pio-start-all</code></p><h2>Check Status</h2><p>At any time you can run:</p><p><code>$ pio status</code></p><p>Which checks the status of PredictionIO and it's dependencies.</p></li><li><h2>Build</h2><p>All engine commands need to be run from within the engine directory:</p><p><code>$ cd ~/PredictionIO/MyEngine</code></p><p>Build the engine with:</p><p><code>$ pio build</code></p></li><li><h2>Train and Deploy</h2><h3>Train the engine</h3><p><a href="http://grouplens.org/datasets/movielens/">Sample data</a> is a
 lready imported, you can train the model the data by running:</p><p><code>$ pio train</code></p><h3>Deploy the trained engine</h3><p>Deploy the trained engine as a background process:</p><p><code>$ pio deploy &</code></p></li><li><h2>Querying Results</h2><p>You can query results using cURL with after you see "Ready to serve":</p><p><code>$ curl -H "Content-Type: application/json" -d '{ "items": ["296"], "num": 5 }' http://localhost:8000/queries.json</code></p><p>This will return 5 recommended movies for movie 296 (Pulp Fiction).</p></li><li><h2>Next Steps</h2><p><a href="http://predictionio.apache.org/install/">Install</a> PredictionIO on your own computer!</p><h3>Support</h3><p>Get support on our <a href="https://groups.google.com/forum/#!forum/predictionio-user">Google Group</a> or on Twitter <a href="https://twitter.com/predictionio/">@PredictionIO</a></p></li></ul><div class="jcarousel-controls"><a href="#" class="jcarousel-control-prev">&lsaquo; Prev</a><a href="#" class="jcaro
 usel-control-next">Next &rsaquo;</a></div></div></div></div><div class="iframe"><iframe src="https://codepicnic.com/bites/predictionio-0-9-1/embed?sidebar=closed&hostname=predictionio&hide=readme"></iframe></div></div></div></main></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-subscribe@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="//prediction
 io.apache.org/community/contribute-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-subscribe@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="social-icons-wrapper"><a class="github-button" href="https://github.com/apache/predictionio" data-style="mega" data-count-href="/apache/predictionio/stargazers" data-count-api="/repos/apache/predictionio#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star apache/predictionio on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/predictionio/fork" data-icon="octicon-git-branch" data-style="mega" data-count-href="/apache/predictionio/network" data-count-api="/repos/apache/predictionio#forks_count" data-count-aria-label="# forks on GitHub" 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 o
 n 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);
 e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
 })(window,document,'script','//s.swiftypecdn.com/install/v1/st.js','_st');


[02/11] predictionio-site git commit: Documentation based on apache/predictionio#54415e1066ae2d646eef62ebfdf801ace1de2097

Posted by gi...@apache.org.
http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/templates/similarproduct/multi-events-multi-algos/index.html
----------------------------------------------------------------------
diff --git a/templates/similarproduct/multi-events-multi-algos/index.html b/templates/similarproduct/multi-events-multi-algos/index.html
index b48410b..f00d7b1 100644
--- a/templates/similarproduct/multi-events-multi-algos/index.html
+++ b/templates/similarproduct/multi-events-multi-algos/index.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><title>Multiple Events and Multiple Algorithms</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Multiple Events and Multiple Algorithms"/><link rel="canonical" href="https://predictionio.apache.org/templates/similarproduct/multi-events-multi-algos/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5
 shiv.min.js"></script><script src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="search-bar-row-wrapper"><div class="container-fluid" id="search-bar-row"><div cl
 ass="row"><div class="col-md-9 col-sm-11 col-xs-11"><div class="hidden-md hidden-lg" id="mobile-page-heading-wrapper"><p>PredictionIO Docs</p><h4>Multiple Events and Multiple Algorithms</h4></div><h4 class="hidden-sm hidden-xs">PredictionIO Docs</h4></div><div class="col-md-3 col-sm-1 col-xs-1 hidden-md hidden-lg"><img id="left-menu-indicator" src="/images/icons/down-arrow-dfe9f7fe.png"/></div><div class="col-md-3 col-sm-12 col-xs-12 swiftype-wrapper"><div class="swiftype"><form class="search-form"><img class="search-box-toggler hidden-xs hidden-sm" src="/images/icons/search-glass-704bd4ff.png"/><div class="search-box"><img src="/images/icons/search-glass-704bd4ff.png"/><input type="text" id="st-search-input" class="st-search-input" placeholder="Search Doc..."/></div><img class="swiftype-row-hider hidden-md hidden-lg" src="/images/icons/drawer-toggle-active-fcbef12a.png"/></form></div></div><div class="mobile-left-menu-toggler hidden-md hidden-lg"></div></div></div></div><div id="pa
 ge" class="container-fluid"><div class="row"><div id="left-menu-wrapper" class="col-md-3"><nav id="nav-main"><ul><li class="level-1"><a class="expandible" href="/"><span>Apache PredictionIO® Documentation</span></a><ul><li class="level-2"><a class="final" href="/"><span>Welcome to Apache PredictionIO®</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Started</span></a><ul><li class="level-2"><a class="final" href="/start/"><span>A Quick Intro</span></a></li><li class="level-2"><a class="final" href="/install/"><span>Installing Apache PredictionIO</span></a></li><li class="level-2"><a class="final" href="/start/download/"><span>Downloading an Engine Template</span></a></li><li class="level-2"><a class="final" href="/start/deploy/"><span>Deploying Your First Engine</span></a></li><li class="level-2"><a class="final" href="/start/customize/"><span>Customizing the Engine</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"
 ><span>Integrating with Your App</span></a><ul><li class="level-2"><a class="final" href="/appintegration/"><span>App Integration Overview</span></a></li><li class="level-2"><a class="expandible" href="/sdk/"><span>List of SDKs</span></a><ul><li class="level-3"><a class="final" href="/sdk/java/"><span>Java & Android SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/php/"><span>PHP SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/python/"><span>Python SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/ruby/"><span>Ruby SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/community/"><span>Community Powered SDKs</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Deploying an Engine</span></a><ul><li class="level-2"><a class="final" href="/deploy/"><span>Deploying as a Web Service</span></a></li><li class="level-2"><a class="final" href="/batchpredict/"><span>Batch Predictions</spa
 n></a></li><li class="level-2"><a class="final" href="/deploy/monitoring/"><span>Monitoring Engine</span></a></li><li class="level-2"><a class="final" href="/deploy/engineparams/"><span>Setting Engine Parameters</span></a></li><li class="level-2"><a class="final" href="/deploy/enginevariants/"><span>Deploying Multiple Engine Variants</span></a></li><li class="level-2"><a class="final" href="/deploy/plugin/"><span>Engine Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Customizing an Engine</span></a><ul><li class="level-2"><a class="final" href="/customize/"><span>Learning DASE</span></a></li><li class="level-2"><a class="final" href="/customize/dase/"><span>Implement DASE</span></a></li><li class="level-2"><a class="final" href="/customize/troubleshooting/"><span>Troubleshooting Engine Development</span></a></li><li class="level-2"><a class="final" href="/api/current/#package"><span>Engine Scala APIs</span></a></li></ul></li><li class=
 "level-1"><a class="expandible" href="#"><span>Collecting and Analyzing Data</span></a><ul><li class="level-2"><a class="final" href="/datacollection/"><span>Event Server Overview</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventapi/"><span>Collecting Data with REST/SDKs</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventmodel/"><span>Events Modeling</span></a></li><li class="level-2"><a class="final" href="/datacollection/webhooks/"><span>Unifying Multichannel Data with Webhooks</span></a></li><li class="level-2"><a class="final" href="/datacollection/channel/"><span>Channel</span></a></li><li class="level-2"><a class="final" href="/datacollection/batchimport/"><span>Importing Data in Batch</span></a></li><li class="level-2"><a class="final" href="/datacollection/analytics/"><span>Using Analytics Tools</span></a></li><li class="level-2"><a class="final" href="/datacollection/plugin/"><span>Event Server Plugin</span></a></li>
 </ul></li><li class="level-1"><a class="expandible" href="#"><span>Choosing an Algorithm(s)</span></a><ul><li class="level-2"><a class="final" href="/algorithm/"><span>Built-in Algorithm Libraries</span></a></li><li class="level-2"><a class="final" href="/algorithm/switch/"><span>Switching to Another Algorithm</span></a></li><li class="level-2"><a class="final" href="/algorithm/multiple/"><span>Combining Multiple Algorithms</span></a></li><li class="level-2"><a class="final" href="/algorithm/custom/"><span>Adding Your Own Algorithms</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>ML Tuning and Evaluation</span></a><ul><li class="level-2"><a class="final" href="/evaluation/"><span>Overview</span></a></li><li class="level-2"><a class="final" href="/evaluation/paramtuning/"><span>Hyperparameter Tuning</span></a></li><li class="level-2"><a class="final" href="/evaluation/evaluationdashboard/"><span>Evaluation Dashboard</span></a></li><li class="level-2"
 ><a class="final" href="/evaluation/metricchoose/"><span>Choosing Evaluation Metrics</span></a></li><li class="level-2"><a class="final" href="/evaluation/metricbuild/"><span>Building Evaluation Metrics</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>System Architecture</span></a><ul><li class="level-2"><a class="final" href="/system/"><span>Architecture Overview</span></a></li><li class="level-2"><a class="final" href="/system/anotherdatastore/"><span>Using Another Data Store</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>PredictionIO® Official Templates</span></a><ul><li class="level-2"><a class="final" href="/templates/"><span>Intro</span></a></li><li class="level-2"><a class="expandible" href="#"><span>Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/recommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/recommendatio
 n/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/evaluation/"><span>Evaluation Explained</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/reading-custom-events/"><span>Read Custom Events</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-data-prep/"><span>Customize Data Preparator</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-serving/"><span>Customize Serving</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/training-with-implicit-preference/"><span>Train with Implicit Preference</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/blacklist-items/"><span>Filter Recommended Items by Blacklist in Query</span></a></li><li class="level-3"><
 a class="final" href="/templates/recommendation/batch-evaluator/"><span>Batch Persistable Evaluator</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>E-Commerce Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/adjust-score/"><span>Adjust Score</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Similar Product</span></a><ul><li class="level-3"><a class="final" href="/templates/si
 milarproduct/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final active" href="/templates/similarproduct/multi-events-multi-algos/"><span>Multiple Events and Multiple Algorithms</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/return-item-properties/"><span>Returns Item Properties</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/rid-user-set-event/"><span>Get Rid of Events for Users</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/recommended-user/"><span>Recommend Users</span></a></li></ul></li><li class="level-
 2"><a class="expandible" href="#"><span>Classification</span></a><ul><li class="level-3"><a class="final" href="/templates/classification/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/classification/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/classification/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/classification/add-algorithm/"><span>Use Alternative Algorithm</span></a></li><li class="level-3"><a class="final" href="/templates/classification/reading-custom-properties/"><span>Read Custom Properties</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Engine Template Gallery</span></a><ul><li class="level-2"><a class="final" href="/gallery/template-gallery/"><span>Browse</span></a></li><li class="level-2"><a class="final" href="/community/submit-template/"><span>Submit your Engine as a Template</span><
 /a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Demo Tutorials</span></a><ul><li class="level-2"><a class="final" href="/demo/tapster/"><span>Comics Recommendation Demo</span></a></li><li class="level-2"><a class="final" href="/demo/community/"><span>Community Contributed Demo</span></a></li><li class="level-2"><a class="final" href="/demo/textclassification/"><span>Text Classification Engine Tutorial</span></a></li></ul></li><li class="level-1"><a class="expandible" href="/community/"><span>Getting Involved</span></a><ul><li class="level-2"><a class="final" href="/community/contribute-code/"><span>Contribute Code</span></a></li><li class="level-2"><a class="final" href="/community/contribute-documentation/"><span>Contribute Documentation</span></a></li><li class="level-2"><a class="final" href="/community/contribute-sdk/"><span>Contribute a SDK</span></a></li><li class="level-2"><a class="final" href="/community/contribute-webhook/"><span>Contribute a Web
 hook</span></a></li><li class="level-2"><a class="final" href="/community/projects/"><span>Community Projects</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Help</span></a><ul><li class="level-2"><a class="final" href="/resources/faq/"><span>FAQs</span></a></li><li class="level-2"><a class="final" href="/support/"><span>Support</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Resources</span></a><ul><li class="level-2"><a class="final" href="/cli/"><span>Command-line Interface</span></a></li><li class="level-2"><a class="final" href="/resources/release/"><span>Release Cadence</span></a></li><li class="level-2"><a class="final" href="/resources/intellij/"><span>Developing Engines with IntelliJ IDEA</span></a></li><li class="level-2"><a class="final" href="/resources/upgrade/"><span>Upgrade Instructions</span></a></li><li class="level-2"><a class="final" href="/resources/glossary/"><span>Glossary</span></a></l
 i></ul></li><li class="level-1"><a class="expandible" href="#"><span>Apache Software Foundation</span></a><ul><li class="level-2"><a class="final" href="https://www.apache.org/"><span>Apache Homepage</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/licenses/"><span>License</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/sponsorship.html"><span>Sponsorship</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/thanks.html"><span>Thanks</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/security/"><span>Security</span></a></li></ul></li></ul></nav></div><div class="col-md-9 col-sm-12"><div class="content-header hidden-md hidden-lg"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">PredictionIO® Official Templates</a><span class="spacer">&gt;</span></li><li><a href="#">Similar Product</a><span class="spacer">&gt;</span></li>
 <li><span class="last">Multiple Events and Multiple Algorithms</span></li></ul></div><div id="page-title"><h1>Multiple Events and Multiple Algorithms</h1></div></div><div id="table-of-content-wrapper"><a id="edit-page-link" href="https://github.com/apache/predictionio/tree/livedoc/docs/manual/source/templates/similarproduct/multi-events-multi-algos.html.md.erb"><img src="/images/icons/edit-pencil-d6c1bb3d.png"/>Edit this page</a></div><div class="content-header hidden-sm hidden-xs"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">PredictionIO® Official Templates</a><span class="spacer">&gt;</span></li><li><a href="#">Similar Product</a><span class="spacer">&gt;</span></li><li><span class="last">Multiple Events and Multiple Algorithms</span></li></ul></div><div id="page-title"><h1>Multiple Events and Multiple Algorithms</h1></div></div><div class="content"> <p>This is more advanced example, we recommend you go through the <a href="/templates/similarproduct/dase/
 ">DASE</a> explanation first.</p><p>The <a href="/templates/similarproduct/dase/#algorithm">default algorithm described in DASE</a> uses user-to-item view events as training data. However, your application may have more than one type of events which you want to take into account, such as buy, rate and like events. One way to incorporate other types of events to improve the system is to add another algorithm to process these events, build a separated model and then combine the outputs of multiple algorithms during Serving.</p><p>In this example, we will add another algorithm to process like/dislike events. The final PredictedResults will be the combined outputs of both algorithms.</p><div class="alert-message note"><p>This is just one of the ways to handle mutliple types of events. We use this use case to demonstrate how one can build an engine with multiple algorithms. You may also build one single algorithm which takes different events into account without using multiple algorithms
 .</p></div><p>This example will demonstrate the following:</p> <ul> <li>Read multiple types of events</li> <li>Use positive and negative implicit events such as like and dislike with MLlib ALS algorithm</li> <li>Integrate multiple algorithms into one engine</li> </ul> <p>The complete source code of this examlpe can be found in <a href="https://github.com/apache/predictionio/tree/develop/examples/scala-parallel-similarproduct/multi-events-multi-algos">here</a>.</p><h3 id='step-1.-read-&quot;like&quot;-and-&quot;dislike&quot;-events-as-trainingdata' class='header-anchors'>Step 1. Read &quot;like&quot; and &quot;dislike&quot; events as TrainingData</h3><p>Modify the following in DataSource.scala:</p> <ul> <li>In addition to the original <code>ViewEvent</code> class, add a new class <code>LikeEvent</code> which has a boolean <code>like</code> field to represent it&#39;s like or dislike event.</li> <li>Add a new field <code>likeEvents</code> into <code>TrainingData</code> class to store 
 the <code>RDD[LikeEvent]</code>.</li> <li>Modidy DataSource&#39;s <code>readTraining()</code> function to read &quot;like&quot; and &quot;dislike&quot; events from the Event Store.</li> </ul> <p>The modification is shown below:</p><div class="highlight scala"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1
+<!DOCTYPE html><html><head><title>Multiple Events and Multiple Algorithms</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Multiple Events and Multiple Algorithms"/><link rel="canonical" href="https://predictionio.apache.org/templates/similarproduct/multi-events-multi-algos/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5
 shiv.min.js"></script><script src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="search-bar-row-wrapper"><div class="container-fluid" id="search-bar-row"><div cl
 ass="row"><div class="col-md-9 col-sm-11 col-xs-11"><div class="hidden-md hidden-lg" id="mobile-page-heading-wrapper"><p>PredictionIO Docs</p><h4>Multiple Events and Multiple Algorithms</h4></div><h4 class="hidden-sm hidden-xs">PredictionIO Docs</h4></div><div class="col-md-3 col-sm-1 col-xs-1 hidden-md hidden-lg"><img id="left-menu-indicator" src="/images/icons/down-arrow-dfe9f7fe.png"/></div><div class="col-md-3 col-sm-12 col-xs-12 swiftype-wrapper"><div class="swiftype"><form class="search-form"><img class="search-box-toggler hidden-xs hidden-sm" src="/images/icons/search-glass-704bd4ff.png"/><div class="search-box"><img src="/images/icons/search-glass-704bd4ff.png"/><input type="text" id="st-search-input" class="st-search-input" placeholder="Search Doc..."/></div><img class="swiftype-row-hider hidden-md hidden-lg" src="/images/icons/drawer-toggle-active-fcbef12a.png"/></form></div></div><div class="mobile-left-menu-toggler hidden-md hidden-lg"></div></div></div></div><div id="pa
 ge" class="container-fluid"><div class="row"><div id="left-menu-wrapper" class="col-md-3"><nav id="nav-main"><ul><li class="level-1"><a class="expandible" href="/"><span>Apache PredictionIO® Documentation</span></a><ul><li class="level-2"><a class="final" href="/"><span>Welcome to Apache PredictionIO®</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Started</span></a><ul><li class="level-2"><a class="final" href="/start/"><span>A Quick Intro</span></a></li><li class="level-2"><a class="final" href="/install/"><span>Installing Apache PredictionIO</span></a></li><li class="level-2"><a class="final" href="/start/download/"><span>Downloading an Engine Template</span></a></li><li class="level-2"><a class="final" href="/start/deploy/"><span>Deploying Your First Engine</span></a></li><li class="level-2"><a class="final" href="/start/customize/"><span>Customizing the Engine</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"
 ><span>Integrating with Your App</span></a><ul><li class="level-2"><a class="final" href="/appintegration/"><span>App Integration Overview</span></a></li><li class="level-2"><a class="expandible" href="/sdk/"><span>List of SDKs</span></a><ul><li class="level-3"><a class="final" href="/sdk/java/"><span>Java & Android SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/php/"><span>PHP SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/python/"><span>Python SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/ruby/"><span>Ruby SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/community/"><span>Community Powered SDKs</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Deploying an Engine</span></a><ul><li class="level-2"><a class="final" href="/deploy/"><span>Deploying as a Web Service</span></a></li><li class="level-2"><a class="final" href="/batchpredict/"><span>Batch Predictions</spa
 n></a></li><li class="level-2"><a class="final" href="/deploy/monitoring/"><span>Monitoring Engine</span></a></li><li class="level-2"><a class="final" href="/deploy/engineparams/"><span>Setting Engine Parameters</span></a></li><li class="level-2"><a class="final" href="/deploy/enginevariants/"><span>Deploying Multiple Engine Variants</span></a></li><li class="level-2"><a class="final" href="/deploy/plugin/"><span>Engine Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Customizing an Engine</span></a><ul><li class="level-2"><a class="final" href="/customize/"><span>Learning DASE</span></a></li><li class="level-2"><a class="final" href="/customize/dase/"><span>Implement DASE</span></a></li><li class="level-2"><a class="final" href="/customize/troubleshooting/"><span>Troubleshooting Engine Development</span></a></li><li class="level-2"><a class="final" href="/api/current/#package"><span>Engine Scala APIs</span></a></li></ul></li><li class=
 "level-1"><a class="expandible" href="#"><span>Collecting and Analyzing Data</span></a><ul><li class="level-2"><a class="final" href="/datacollection/"><span>Event Server Overview</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventapi/"><span>Collecting Data with REST/SDKs</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventmodel/"><span>Events Modeling</span></a></li><li class="level-2"><a class="final" href="/datacollection/webhooks/"><span>Unifying Multichannel Data with Webhooks</span></a></li><li class="level-2"><a class="final" href="/datacollection/channel/"><span>Channel</span></a></li><li class="level-2"><a class="final" href="/datacollection/batchimport/"><span>Importing Data in Batch</span></a></li><li class="level-2"><a class="final" href="/datacollection/analytics/"><span>Using Analytics Tools</span></a></li><li class="level-2"><a class="final" href="/datacollection/plugin/"><span>Event Server Plugin</span></a></li>
 </ul></li><li class="level-1"><a class="expandible" href="#"><span>Choosing an Algorithm(s)</span></a><ul><li class="level-2"><a class="final" href="/algorithm/"><span>Built-in Algorithm Libraries</span></a></li><li class="level-2"><a class="final" href="/algorithm/switch/"><span>Switching to Another Algorithm</span></a></li><li class="level-2"><a class="final" href="/algorithm/multiple/"><span>Combining Multiple Algorithms</span></a></li><li class="level-2"><a class="final" href="/algorithm/custom/"><span>Adding Your Own Algorithms</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>ML Tuning and Evaluation</span></a><ul><li class="level-2"><a class="final" href="/evaluation/"><span>Overview</span></a></li><li class="level-2"><a class="final" href="/evaluation/paramtuning/"><span>Hyperparameter Tuning</span></a></li><li class="level-2"><a class="final" href="/evaluation/evaluationdashboard/"><span>Evaluation Dashboard</span></a></li><li class="level-2"
 ><a class="final" href="/evaluation/metricchoose/"><span>Choosing Evaluation Metrics</span></a></li><li class="level-2"><a class="final" href="/evaluation/metricbuild/"><span>Building Evaluation Metrics</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>System Architecture</span></a><ul><li class="level-2"><a class="final" href="/system/"><span>Architecture Overview</span></a></li><li class="level-2"><a class="final" href="/system/anotherdatastore/"><span>Using Another Data Store</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>PredictionIO® Official Templates</span></a><ul><li class="level-2"><a class="final" href="/templates/"><span>Intro</span></a></li><li class="level-2"><a class="expandible" href="#"><span>Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/recommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/recommendatio
 n/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/evaluation/"><span>Evaluation Explained</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/reading-custom-events/"><span>Read Custom Events</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-data-prep/"><span>Customize Data Preparator</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-serving/"><span>Customize Serving</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/training-with-implicit-preference/"><span>Train with Implicit Preference</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/blacklist-items/"><span>Filter Recommended Items by Blacklist in Query</span></a></li><li class="level-3"><
 a class="final" href="/templates/recommendation/batch-evaluator/"><span>Batch Persistable Evaluator</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>E-Commerce Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/adjust-score/"><span>Adjust Score</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Similar Product</span></a><ul><li class="level-3"><a class="final" href="/templates/si
 milarproduct/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final active" href="/templates/similarproduct/multi-events-multi-algos/"><span>Multiple Events and Multiple Algorithms</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/return-item-properties/"><span>Returns Item Properties</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/rid-user-set-event/"><span>Get Rid of Events for Users</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/recommended-user/"><span>Recommend Users</span></a></li></ul></li><li class="level-
 2"><a class="expandible" href="#"><span>Classification</span></a><ul><li class="level-3"><a class="final" href="/templates/classification/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/classification/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/classification/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/classification/add-algorithm/"><span>Use Alternative Algorithm</span></a></li><li class="level-3"><a class="final" href="/templates/classification/reading-custom-properties/"><span>Read Custom Properties</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Engine Template Gallery</span></a><ul><li class="level-2"><a class="final" href="/gallery/template-gallery/"><span>Browse</span></a></li><li class="level-2"><a class="final" href="/community/submit-template/"><span>Submit your Engine as a Template</span><
 /a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Demo Tutorials</span></a><ul><li class="level-2"><a class="final" href="/demo/tapster/"><span>Comics Recommendation Demo</span></a></li><li class="level-2"><a class="final" href="/demo/community/"><span>Community Contributed Demo</span></a></li><li class="level-2"><a class="final" href="/demo/textclassification/"><span>Text Classification Engine Tutorial</span></a></li></ul></li><li class="level-1"><a class="expandible" href="/community/"><span>Getting Involved</span></a><ul><li class="level-2"><a class="final" href="/community/contribute-code/"><span>Contribute Code</span></a></li><li class="level-2"><a class="final" href="/community/contribute-documentation/"><span>Contribute Documentation</span></a></li><li class="level-2"><a class="final" href="/community/contribute-sdk/"><span>Contribute a SDK</span></a></li><li class="level-2"><a class="final" href="/community/contribute-webhook/"><span>Contribute a Web
 hook</span></a></li><li class="level-2"><a class="final" href="/community/projects/"><span>Community Projects</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Help</span></a><ul><li class="level-2"><a class="final" href="/resources/faq/"><span>FAQs</span></a></li><li class="level-2"><a class="final" href="/support/"><span>Support</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Resources</span></a><ul><li class="level-2"><a class="final" href="/cli/"><span>Command-line Interface</span></a></li><li class="level-2"><a class="final" href="/resources/release/"><span>Release Cadence</span></a></li><li class="level-2"><a class="final" href="/resources/intellij/"><span>Developing Engines with IntelliJ IDEA</span></a></li><li class="level-2"><a class="final" href="/resources/upgrade/"><span>Upgrade Instructions</span></a></li><li class="level-2"><a class="final" href="/resources/glossary/"><span>Glossary</span></a></l
 i></ul></li><li class="level-1"><a class="expandible" href="#"><span>Apache Software Foundation</span></a><ul><li class="level-2"><a class="final" href="https://www.apache.org/"><span>Apache Homepage</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/licenses/"><span>License</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/sponsorship.html"><span>Sponsorship</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/thanks.html"><span>Thanks</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/security/"><span>Security</span></a></li></ul></li></ul></nav></div><div class="col-md-9 col-sm-12"><div class="content-header hidden-md hidden-lg"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">PredictionIO® Official Templates</a><span class="spacer">&gt;</span></li><li><a href="#">Similar Product</a><span class="spacer">&gt;</span></li>
 <li><span class="last">Multiple Events and Multiple Algorithms</span></li></ul></div><div id="page-title"><h1>Multiple Events and Multiple Algorithms</h1></div></div><div id="table-of-content-wrapper"><a id="edit-page-link" href="https://github.com/apache/predictionio/tree/livedoc/docs/manual/source/templates/similarproduct/multi-events-multi-algos.html.md.erb"><img src="/images/icons/edit-pencil-d6c1bb3d.png"/>Edit this page</a></div><div class="content-header hidden-sm hidden-xs"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">PredictionIO® Official Templates</a><span class="spacer">&gt;</span></li><li><a href="#">Similar Product</a><span class="spacer">&gt;</span></li><li><span class="last">Multiple Events and Multiple Algorithms</span></li></ul></div><div id="page-title"><h1>Multiple Events and Multiple Algorithms</h1></div></div><div class="content"> <p>This is more advanced example, we recommend you go through the <a href="/templates/similarproduct/dase/
 ">DASE</a> explanation first.</p><p>The <a href="/templates/similarproduct/dase/#algorithm">default algorithm described in DASE</a> uses user-to-item view events as training data. However, your application may have more than one type of events which you want to take into account, such as buy, rate and like events. One way to incorporate other types of events to improve the system is to add another algorithm to process these events, build a separated model and then combine the outputs of multiple algorithms during Serving.</p><p>In this example, we will add another algorithm to process like/dislike events. The final PredictedResults will be the combined outputs of both algorithms.</p><div class="alert-message note"><p>This is just one of the ways to handle multiple types of events. We use this use case to demonstrate how one can build an engine with multiple algorithms. You may also build one single algorithm which takes different events into account without using multiple algorithms
 .</p></div><p>This example will demonstrate the following:</p> <ul> <li>Read multiple types of events</li> <li>Use positive and negative implicit events such as like and dislike with MLlib ALS algorithm</li> <li>Integrate multiple algorithms into one engine</li> </ul> <p>The complete source code of this examlpe can be found in <a href="https://github.com/apache/predictionio/tree/develop/examples/scala-parallel-similarproduct/multi-events-multi-algos">here</a>.</p><h3 id='step-1.-read-&quot;like&quot;-and-&quot;dislike&quot;-events-as-trainingdata' class='header-anchors'>Step 1. Read &quot;like&quot; and &quot;dislike&quot; events as TrainingData</h3><p>Modify the following in DataSource.scala:</p> <ul> <li>In addition to the original <code>ViewEvent</code> class, add a new class <code>LikeEvent</code> which has a boolean <code>like</code> field to represent it&#39;s like or dislike event.</li> <li>Add a new field <code>likeEvents</code> into <code>TrainingData</code> class to store 
 the <code>RDD[LikeEvent]</code>.</li> <li>Modidy DataSource&#39;s <code>readTraining()</code> function to read &quot;like&quot; and &quot;dislike&quot; events from the Event Store.</li> </ul> <p>The modification is shown below:</p><div class="highlight scala"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -564,7 +564,7 @@
   </span><span class="p">]</span><span class="w">
 </span><span class="p">}</span><span class="w">
 
-</span></pre></td></tr></tbody></table> </div> <div class="alert-message info"><p>You may notice that the parameters of the new <code>&quot;likealgo&quot;</code> contains the same fields as <code>&quot;als&quot;</code>. It is just becasuse the <code>LikeAlgorithm</code> class extends the original <code>ALSAlgorithm</code> class and shares the same algorithm parameter class defintion. If the other algorithm you add has its own parameter class, you just need to specify them inside its <code>params</code> field accordingly.</p></div><p>That&#39;s it! Now you have a engine configured with two algorithms.</p><h3 id='sample-data-with-&quot;like&quot;-and-&quot;dislike&quot;-events' class='header-anchors'>Sample data with &quot;like&quot; and &quot;dislike&quot; events</h3><p>For demonstration purpose, a sample import script is also provided for you to quickly test this engine. The script is modified from the original one used in <a href="/templates/similarproduct/quickstart/#import-more-s
 ample-data">Quick Start</a> with the addition of importing like and dislike events.</p><p>You could find the import script in <code>data/import_eventserver.py</code>.</p><p>Make sure you are under the App directory. Execute the following to import the data (Replace the value of access_key parameter with your <strong>Access Key</strong>):</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>python data/import_eventserver.py --access_key 3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F
+</span></pre></td></tr></tbody></table> </div> <div class="alert-message info"><p>You may notice that the parameters of the new <code>&quot;likealgo&quot;</code> contains the same fields as <code>&quot;als&quot;</code>. It is just becasuse the <code>LikeAlgorithm</code> class extends the original <code>ALSAlgorithm</code> class and shares the same algorithm parameter class definition. If the other algorithm you add has its own parameter class, you just need to specify them inside its <code>params</code> field accordingly.</p></div><p>That&#39;s it! Now you have a engine configured with two algorithms.</p><h3 id='sample-data-with-&quot;like&quot;-and-&quot;dislike&quot;-events' class='header-anchors'>Sample data with &quot;like&quot; and &quot;dislike&quot; events</h3><p>For demonstration purpose, a sample import script is also provided for you to quickly test this engine. The script is modified from the original one used in <a href="/templates/similarproduct/quickstart/#import-more-
 sample-data">Quick Start</a> with the addition of importing like and dislike events.</p><p>You could find the import script in <code>data/import_eventserver.py</code>.</p><p>Make sure you are under the App directory. Execute the following to import the data (Replace the value of access_key parameter with your <strong>Access Key</strong>):</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>python data/import_eventserver.py --access_key 3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F
 </pre></td></tr></tbody></table> </div> <div class="alert-message warning"><p>If you see error <strong>TypeError: <strong>init</strong>() got an unexpected keyword argument &#39;access_key&#39;</strong>, please update the Python SDK to the latest version.</p></div><p>You are ready to run pio build, train and deploy as described in the <a href="/templates/similarproduct/quickstart/#5.-deploy-the-engine-as-a-service">Quick Start</a>.</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-subscribe@predictionio.apache.org" target="blank">Subscribe to User Mailing List</a></li><li><a href="//st
 ackoverflow.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/contribute-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-subscribe@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 respect
 ive 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="social-icons-wrapper"><a class="github-button" href="https://github.com/apache/predictionio" data-style="mega" data-count-href="/apache/predictionio/stargazers" data-count-api="/repos/apache/predictionio#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star apache/predictionio on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/predictionio/fork" data-icon="octicon-git-branch" data-style="mega" data-count-href="/apache/predictionio/network" data-count-api="/repos/apache/predictionio#forks_count" data-count-aria-label="# forks on GitHub" 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);
 e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);

http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/templates/similarproduct/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/similarproduct/quickstart/index.html b/templates/similarproduct/quickstart/index.html
index 8306da4..0f3696d 100644
--- a/templates/similarproduct/quickstart/index.html
+++ b/templates/similarproduct/quickstart/index.html
@@ -32,7 +32,7 @@ Your system is all ready to go.
 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span>               MyApp1 |    1 | 3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F | <span class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span>               MyApp2 |    2 | io5lz6Eg4m3Xe4JZTBFE13GMAf1dhFl6ZteuJfrO84XpdOz9wRCrDU44EUaYuXq5 | <span class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span> Finished listing 2 app<span class="o">(</span>s<span class="o">)</span>.
-</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, let&#39;s collect some training data for the app of this Engine. By default, the Similar Product Engine Template supports 2 types of entities: <strong>user</strong> and <strong>item</strong>, and event <strong>view</strong>. An item has the <strong>categories</strong> property, which is a list of category names (String). A user can view an item. Respectively, this template requires &#39;$set&#39; user event, &#39;$set&#39; item event, and user-view-item events.</p><div class="alert-message info"><p>This template can easily be customized to consider more user events such as <em>buy</em>, <em>rate</em> and <em>like</em>.</p></div> <p>You can send these events to PredictionIO Event Server in real-time easily by making a HTTP request or through the provided SDK. Please see <a href="/appintegration/">App Integration Overview</a> for more detai
 ls 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-e113df2f-55c7-4e0c-b2c0-ccc6bc572009">REST API</a></li> <li data-lang="python"><a href="#tab-ec4b238a-c8
 d7-4119-aab7-f51c16a74715">Python SDK</a></li> <li data-lang="php"><a href="#tab-3b3455f3-8b6e-429a-91d2-8de5893fe342">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-8ce092a6-a980-45dc-b933-ff597407f0c0">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-9c454b58-ef50-4a23-a835-f4e5afe647d6">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-e113df2f-55c7-4e0c-b2c0-ccc6bc572009"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, let&#39;s collect some training data for the app of this Engine. By default, the Similar Product Engine Template supports 2 types of entities: <strong>user</strong> and <strong>item</strong>, and event <strong>view</strong>. An item has the <strong>categories</strong> property, which is a list of category names (String). A user can view an item. Respectively, this template requires &#39;$set&#39; user event, &#39;$set&#39; item event, and user-view-item events.</p><div class="alert-message info"><p>This template can easily be customized to consider more user events such as <em>buy</em>, <em>rate</em> and <em>like</em>.</p></div> <p>You can send these events to PredictionIO Event Server in real-time easily by making a HTTP request or through the provided SDK. Please see <a href="/appintegration/">App Integration Overview</a> for more detai
 ls 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-a448e8e1-efe9-48c7-bb50-3bac5b88e4f0">REST API</a></li> <li data-lang="python"><a href="#tab-0569b290-10
 89-4e2d-b55b-f6ebbd62a161">Python SDK</a></li> <li data-lang="php"><a href="#tab-2903cc97-a53b-49c2-b98f-0c1346d1e9b7">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-c3bc35f3-0c7b-4569-869b-728d8becc60d">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-54a1211c-369f-47bb-9d4e-b820549f24d6">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-a448e8e1-efe9-48c7-bb50-3bac5b88e4f0"> <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-ec4b238a-c8d7-4119-aab7-f51c16a74715"> <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-0569b290-1089-4e2d-b55b-f6ebbd62a161"> <div class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -86,7 +86,7 @@ Your system is all ready to go.
   <span class="n">event_time</span><span class="o">=</span><span class="n">datetime</span><span class="p">(</span>
     <span class="mi">2014</span><span class="p">,</span> <span class="mi">11</span><span class="p">,</span> <span class="mo">02</span><span class="p">,</span> <span class="mi">09</span><span class="p">,</span> <span class="mi">39</span><span class="p">,</span> <span class="mi">45</span><span class="p">,</span> <span class="mi">618000</span><span class="p">,</span> <span class="n">pytz</span><span class="o">.</span><span class="n">timezone</span><span class="p">(</span><span class="s">'US/Pacific'</span><span class="p">)</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-3b3455f3-8b6e-429a-91d2-8de5893fe342"> <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-2903cc97-a53b-49c2-b98f-0c1346d1e9b7"> <div class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -111,7 +111,7 @@ Your system is all ready to go.
   <span class="s1">'entityId'</span> <span class="o">=&gt;</span> <span class="o">&lt;</span><span class="nx">USER</span> <span class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-8ce092a6-a980-45dc-b933-ff597407f0c0"> <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-c3bc35f3-0c7b-4569-869b-728d8becc60d"> <div class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -128,7 +128,7 @@ Your system is all ready to go.
   <span class="s1">'user'</span><span class="p">,</span>
   <span class="o">&lt;</span><span class="no">USER</span> <span class="no">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-9c454b58-ef50-4a23-a835-f4e5afe647d6"> <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-54a1211c-369f-47bb-9d4e-b820549f24d6"> <div class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -153,7 +153,7 @@ Your system is all ready to go.
   <span class="o">.</span><span class="na">entityType</span><span class="o">(</span><span class="s">"user"</span><span class="o">)</span>
   <span class="o">.</span><span class="na">entityId</span><span class="o">(&lt;</span><span class="n">USER_ID</span><span class="o">&gt;);</span>
 <span class="n">client</span><span class="o">.</span><span class="na">createEvent</span><span class="o">(</span><span class="n">userEvent</span><span class="o">);</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a new item &quot;i0&quot; is created in your app on time <code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if eventTime is not specified), you can send a <code>$set</code> event for the item. Note that the item is set with categories properties: <code>&quot;c1&quot;</code> and <code>&quot;c2&quot;</code>. Run the following <code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-93c06926-610e-476b-bef1-e209751359b4">REST API</a></li> <li data-lang="python"><a href="#tab-7722f8d0-2264-4344-88d2-c01a866c6dc0">Python SDK</a></li> <li data-lang="php"><a href="#tab-c32407a8-30e6-490d-aa49-8c854baec43f">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-8556aaf2-5f41-47a3-8dd1-54d91f01f26c">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-cd0a02f3-6aa5-465f-a26c-8ec973414f4d">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-93c069
 26-610e-476b-bef1-e209751359b4"> <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-990de6df-2ddc-41fd-8b50-6ede3f91c02f">REST API</a></li> <li data-lang="python"><a href="#tab-c4d7d9aa-e4ae-406b-9f77-d5a8d96602a0">Python SDK</a></li> <li data-lang="php"><a href="#tab-18d32930-e148-4045-a6eb-d2a6323fd97c">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-f41ac826-e081-44b6-b37f-cf99a9ea9f4e">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-f6c342bb-4480-4415-872e-4b6ba22ed5c0">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-990de6
 df-2ddc-41fd-8b50-6ede3f91c02f"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -174,7 +174,7 @@ Your system is all ready to go.
   }
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-7722f8d0-2264-4344-88d2-c01a866c6dc0"> <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-c4d7d9aa-e4ae-406b-9f77-d5a8d96602a0"> <div class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -193,7 +193,7 @@ Your system is all ready to go.
     <span class="s">"categories"</span> <span class="p">:</span> <span class="p">[</span><span class="s">"&lt;CATEGORY_1&gt;"</span><span class="p">,</span> <span class="s">"&lt;CATEGORY_2&gt;"</span><span class="p">]</span>
   <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-c32407a8-30e6-490d-aa49-8c854baec43f"> <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-18d32930-e148-4045-a6eb-d2a6323fd97c"> <div class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -214,7 +214,7 @@ Your system is all ready to go.
 <span class="p">));</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-8556aaf2-5f41-47a3-8dd1-54d91f01f26c"> <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-f41ac826-e081-44b6-b37f-cf99a9ea9f4e"> <div class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -231,7 +231,7 @@ Your system is all ready to go.
   <span class="p">}</span>
 <span class="p">)</span>
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-cd0a02f3-6aa5-465f-a26c-8ec973414f4d"> <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-f6c342bb-4480-4415-872e-4b6ba22ed5c0"> <div class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -244,7 +244,7 @@ Your system is all ready to go.
   <span class="o">.</span><span class="na">entityId</span><span class="o">(&lt;</span><span class="n">ITEM_ID</span><span class="o">&gt;)</span>
   <span class="o">.</span><span class="na">property</span><span class="o">(</span><span class="s">"categories"</span><span class="o">,</span> <span class="n">ImmutableList</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="s">"&lt;CATEGORY_1&gt;"</span><span class="o">,</span> <span class="s">"&lt;CATEGORY_2&gt;"</span><span class="o">));</span>
 <span class="n">client</span><span class="o">.</span><span class="na">createEvent</span><span class="o">(</span><span class="n">itemEvent</span><span class="o">)</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When the user &quot;u0&quot; view item &quot;i0&quot; on time <code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if eventTime is not specified), you can send a view event. Run the following <code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-1eaf2195-17de-4f66-8d87-09c4628650ab">REST API</a></li> <li data-lang="python"><a href="#tab-b8ead40f-3716-473e-98fc-717412827cdb">Python SDK</a></li> <li data-lang="php"><a href="#tab-a1d0ad6a-38bb-4914-b7a7-a57196b3a402">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-d2042ec7-b41f-46b7-beaa-aeb66c2336b5">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-233b9a11-971b-4156-8482-dc4499135b29">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-1eaf2195-17de-4f66-8d87-09c4628650ab"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text
 -align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <p>When the user &quot;u0&quot; view item &quot;i0&quot; on time <code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if eventTime is not specified), you can send a view event. Run the following <code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-b36aca1b-2788-4ef0-be01-f2456f0732c5">REST API</a></li> <li data-lang="python"><a href="#tab-1ce3fe51-2e8b-4390-8f44-868998e80db7">Python SDK</a></li> <li data-lang="php"><a href="#tab-94d5664f-a464-4e04-b925-3664c585427a">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-8027ae93-61c4-4e6b-9e6f-c109ae8c46de">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-db8e5da5-7756-485c-9f79-51f74b44ab4d">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-b36aca1b-2788-4ef0-be01-f2456f0732c5"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text
 -align: right"><pre class="lineno">1
 2
 3
 4
@@ -263,7 +263,7 @@ Your system is all ready to go.
   "targetEntityId" : "i0",
   "eventTime" : "2014-11-10T12:34:56.123-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-b8ead40f-3716-473e-98fc-717412827cdb"> <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-1ce3fe51-2e8b-4390-8f44-868998e80db7"> <div class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -280,7 +280,7 @@ Your system is all ready to go.
   <span class="n">target_entity_type</span><span class="o">=</span><span class="s">"item"</span><span class="p">,</span>
   <span class="n">target_entity_id</span><span class="o">=&lt;</span><span class="n">ITEM</span> <span class="n">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-a1d0ad6a-38bb-4914-b7a7-a57196b3a402"> <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-94d5664f-a464-4e04-b925-3664c585427a"> <div class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -299,7 +299,7 @@ Your system is all ready to go.
    <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> <span class="o">&lt;</span><span class="nx">ITEM</span> <span class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-d2042ec7-b41f-46b7-beaa-aeb66c2336b5"> <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-8027ae93-61c4-4e6b-9e6f-c109ae8c46de"> <div class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -316,7 +316,7 @@ Your system is all ready to go.
     <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> <span class="o">&lt;</span><span class="no">ITEM</span> <span class="no">ID</span><span class="o">&gt;</span>
   <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-233b9a11-971b-4156-8482-dc4499135b29"> <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-db8e5da5-7756-485c-9f79-51f74b44ab4d"> <div class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -376,19 +376,19 @@ User u10 views item i29
 </pre></td></tr></tbody></table> </div> <p>When the engine is deployed successfully and running, you should see a console message similar to the following:</p><div class="highlight shell"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2</pre></td><td class="code"><pre><span class="o">[</span>INFO] <span class="o">[</span>HttpListener] Bound to /0.0.0.0:8000
 <span class="o">[</span>INFO] <span class="o">[</span>MasterActor] Bind successful. Ready to serve.
-</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine process.</p><p>By default, the deployed engine binds to <a href="http://localhost:8000"><a href="http://localhost:8000">http://localhost:8000</a></a>. You can visit that page in your web browser to check its status.</p><p><img alt="Engine Status" src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' class='header-anchors'>6. Use the Engine</h2><p>Now, You can retrieve predicted results. To retrieve 4 items which are similar to item ID &quot;i1&quot;. You send this JSON <code>{ &quot;items&quot;: [&quot;i1&quot;], &quot;num&quot;: 4 }</code> to the deployed engine and it will return a JSON of the recommended items. Simply send a query by making a HTTP request or through the <code>EngineClient</code> of an SDK.</p><p>With the deployed engine running, open another 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-d0cdcfa0-b76f-4b58-837a-362094f4a9e8">REST API</a></li> <li data-lang="python"><a href="#tab-dd423f43-3bbd-4700-96fb-bc96c6250f48">Python SDK</a></li> <li data-lang="php"><a href="#tab-05a3e4b6-0806-4054-9ed5-d9ed11660191">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-1a71376f-4bd2-475d-89f2-c43b2a70117e">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-c28bfa1e-888a-4b16-87e2-d2a5df0ceee7">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-d0cdcfa0-b76f-4b58-837a-362094f4a9e8"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine process.</p><p>By default, the deployed engine binds to <a href="http://localhost:8000"><a href="http://localhost:8000">http://localhost:8000</a></a>. You can visit that page in your web browser to check its status.</p><p><img alt="Engine Status" src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' class='header-anchors'>6. Use the Engine</h2><p>Now, You can retrieve predicted results. To retrieve 4 items which are similar to item ID &quot;i1&quot;. You send this JSON <code>{ &quot;items&quot;: [&quot;i1&quot;], &quot;num&quot;: 4 }</code> to the deployed engine and it will return a JSON of the recommended items. Simply send a query by making a HTTP request or through the <code>EngineClient</code> of an SDK.</p><p>With the deployed engine running, open another 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-2958d694-df1e-4bb9-8c10-35f4b5d05920">REST API</a></li> <li data-lang="python"><a href="#tab-78376496-a787-4ad4-8717-707a9681d9d0">Python SDK</a></li> <li data-lang="php"><a href="#tab-a83b0ad0-251d-481a-ba90-cbf603120281">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-3625b28b-cc61-4192-bfe1-e7ae1d79236e">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-5b202733-6093-4562-b174-0c5576e08b5d">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-2958d694-df1e-4bb9-8c10-35f4b5d05920"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4</pre></td> <td class="code"><pre><span class="gp">$ </span>curl -H <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
 -d <span class="s1">'{ "items": ["i1"], "num": 4 }'</span> <span class="se">\</span>
 http://localhost:8000/queries.json
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-dd423f43-3bbd-4700-96fb-bc96c6250f48"> <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-78376496-a787-4ad4-8717-707a9681d9d0"> <div class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3</pre></td> <td class="code"><pre><span class="kn">import</span> <span class="nn">predictionio</span>
 <span class="n">engine_client</span> <span class="o">=</span> <span class="n">predictionio</span><span class="o">.</span><span class="n">EngineClient</span><span class="p">(</span><span class="n">url</span><span class="o">=</span><span class="s">"http://localhost:8000"</span><span class="p">)</span>
 <span class="k">print</span> <span class="n">engine_client</span><span class="o">.</span><span class="n">send_query</span><span class="p">({</span><span class="s">"items"</span><span class="p">:</span> <span class="p">[</span><span class="s">"i1"</span><span class="p">],</span> <span class="s">"num"</span><span class="p">:</span> <span class="mi">4</span><span class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-05a3e4b6-0806-4054-9ed5-d9ed11660191"> <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-a83b0ad0-251d-481a-ba90-cbf603120281"> <div class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -407,7 +407,7 @@ http://localhost:8000/queries.json
 <span class="nb">print_r</span><span class="p">(</span><span class="nv">$response</span><span class="p">);</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-1a71376f-4bd2-475d-89f2-c43b2a70117e"> <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-3625b28b-cc61-4192-bfe1-e7ae1d79236e"> <div class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -420,7 +420,7 @@ http://localhost:8000/queries.json
 <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="p">.</span><span class="nf">send_query</span><span class="p">(</span><span class="s1">'items'</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="s1">'i1'</span><span class="p">],</span> <span class="s1">'num'</span> <span class="o">=&gt;</span> <span class="mi">4</span><span class="p">)</span>
 
 <span class="nb">puts</span> <span class="n">response</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-c28bfa1e-888a-4b16-87e2-d2a5df0ceee7"> <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-5b202733-6093-4562-b174-0c5576e08b5d"> <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/c17b9607/templates/vanilla/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/vanilla/quickstart/index.html b/templates/vanilla/quickstart/index.html
index be8bf57..49a6788 100644
--- a/templates/vanilla/quickstart/index.html
+++ b/templates/vanilla/quickstart/index.html
@@ -54,17 +54,17 @@ Your system is all ready to go.
 </pre></td></tr></tbody></table> </div> <p>When the engine is deployed successfully and running, you should see a console message similar to the following:</p><div class="highlight shell"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2</pre></td><td class="code"><pre><span class="o">[</span>INFO] <span class="o">[</span>HttpListener] Bound to /0.0.0.0:8000
 <span class="o">[</span>INFO] <span class="o">[</span>MasterActor] Bind successful. Ready to serve.
-</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine process.</p><p>By default, the deployed engine binds to <a href="http://localhost:8000"><a href="http://localhost:8000">http://localhost:8000</a></a>. You can visit that page in your web browser to check its status.</p><p><img alt="Engine Status" src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' class='header-anchors'>6. Use the Engine</h2><p>Now, You can try to retrieve predicted results. The engine accepts JSON query with the field &#39;q&#39;: <code>{ &quot;q&quot; : &quot;foo&quot; }</code>. A prefix is added to the query data and return as PredictedResult.</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-cfc7fd09-f2e9-40c5-b69c-251a6e8c4139">REST API</a></li> <li data-lang="python"><a href="#tab-3cafc830-c1c5-43
 66-a8ee-fa32ed506984">Python SDK</a></li> <li data-lang="php"><a href="#tab-a633ec01-9bd0-4ac4-bbf9-35f9bfcf6ec9">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-94fc7a74-e6e2-45a0-aa20-1b7be2fe4811">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-417c1368-52ad-4c03-9ece-7c6866c8380c">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-cfc7fd09-f2e9-40c5-b69c-251a6e8c4139"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine process.</p><p>By default, the deployed engine binds to <a href="http://localhost:8000"><a href="http://localhost:8000">http://localhost:8000</a></a>. You can visit that page in your web browser to check its status.</p><p><img alt="Engine Status" src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' class='header-anchors'>6. Use the Engine</h2><p>Now, You can try to retrieve predicted results. The engine accepts JSON query with the field &#39;q&#39;: <code>{ &quot;q&quot; : &quot;foo&quot; }</code>. A prefix is added to the query data and return as PredictedResult.</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-994754d6-7673-43d7-847b-c25cf2551cc9">REST API</a></li> <li data-lang="python"><a href="#tab-6ce2cbbe-ae0b-44
 e3-a731-d6c1ab06928c">Python SDK</a></li> <li data-lang="php"><a href="#tab-089d6761-da90-4894-8c77-f3101efa651d">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-bba206e2-d867-402c-8d70-99d4ba1ab178">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-54caeb13-d56f-40c3-806d-3f941e95da2a">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-994754d6-7673-43d7-847b-c25cf2551cc9"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3</pre></td> <td class="code"><pre><span class="gp">$ </span>curl -H <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
 -d <span class="s1">'{ "q": "foo" }'</span> http://localhost:8000/queries.json
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-3cafc830-c1c5-4366-a8ee-fa32ed506984"> <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-6ce2cbbe-ae0b-44e3-a731-d6c1ab06928c"> <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">"q"</span><span class="p">:</span> <span class="s">"foo"</span> <span class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-a633ec01-9bd0-4ac4-bbf9-35f9bfcf6ec9"> <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-089d6761-da90-4894-8c77-f3101efa651d"> <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
@@ -83,7 +83,7 @@ Your system is all ready to go.
 <span class="nb">print_r</span><span class="p">(</span><span class="nv">$response</span><span class="p">);</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-94fc7a74-e6e2-45a0-aa20-1b7be2fe4811"> <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-bba206e2-d867-402c-8d70-99d4ba1ab178"> <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
@@ -96,7 +96,7 @@ Your system is all ready to go.
 <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="p">.</span><span class="nf">send_query</span><span class="p">(</span><span class="s1">'q'</span> <span class="o">=&gt;</span> <span class="s1">'foo'</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-417c1368-52ad-4c03-9ece-7c6866c8380c"> <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-54caeb13-d56f-40c3-806d-3f941e95da2a"> <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


[11/11] predictionio-site git commit: Documentation based on apache/predictionio#54415e1066ae2d646eef62ebfdf801ace1de2097

Posted by gi...@apache.org.
Documentation based on apache/predictionio#54415e1066ae2d646eef62ebfdf801ace1de2097


Project: http://git-wip-us.apache.org/repos/asf/predictionio-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/predictionio-site/commit/c17b9607
Tree: http://git-wip-us.apache.org/repos/asf/predictionio-site/tree/c17b9607
Diff: http://git-wip-us.apache.org/repos/asf/predictionio-site/diff/c17b9607

Branch: refs/heads/asf-site
Commit: c17b96077035bc02afee626e1a403b6aa67f4086
Parents: 2e455bb
Author: jenkins <bu...@apache.org>
Authored: Sat Aug 11 00:23:55 2018 +0000
Committer: jenkins <bu...@apache.org>
Committed: Sat Aug 11 00:23:55 2018 +0000

----------------------------------------------------------------------
 datacollection/batchimport/index.html           |   4 +-
 datacollection/channel/index.html               |   6 +-
 datacollection/eventapi/index.html              |  20 +-
 deploy/index.html                               |   2 +-
 evaluation/metricbuild/index.html               |   4 +-
 evaluation/metricchoose/index.html              |   2 +-
 evaluation/paramtuning/index.html               |   6 +-
 gallery/template-gallery/index.html             |   2 +-
 gallery/templates.yaml                          |   4 +-
 resources/faq/index.html                        |   2 +-
 samples/tabs/index.html                         |  18 +-
 sitemap.xml                                     | 260 +++++++++----------
 templates/classification/quickstart/index.html  |  30 +--
 templates/complementarypurchase/dase/index.html |   4 +-
 .../complementarypurchase/quickstart/index.html |  20 +-
 .../ecommercerecommendation/dase/index.html     |   2 +-
 .../quickstart/index.html                       |  60 ++---
 .../quickstart/index.html                       |  60 ++---
 templates/leadscoring/dase/index.html           |   2 +-
 templates/leadscoring/quickstart/index.html     |  30 +--
 templates/productranking/quickstart/index.html  |  40 +--
 .../recommendation/batch-evaluator/index.html   |   2 +-
 templates/recommendation/evaluation/index.html  |   2 +-
 templates/recommendation/quickstart/index.html  |  32 +--
 templates/similarproduct/dase/index.html        |   2 +-
 .../multi-events-multi-algos/index.html         |   4 +-
 templates/similarproduct/quickstart/index.html  |  40 +--
 templates/vanilla/quickstart/index.html         |  10 +-
 tryit/index.html                                |   2 +-
 29 files changed, 336 insertions(+), 336 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/datacollection/batchimport/index.html
----------------------------------------------------------------------
diff --git a/datacollection/batchimport/index.html b/datacollection/batchimport/index.html
index a979e5b..b4c83b7 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-7c604a57-12d0-4202-a23f-4298592bda68">PHP SDK</a></li> <li data-lang="python"><a href="#tab-82fa1414-2416-418f-8013-12f921c26b24">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-fcc14827-f55d-4a1f-b90b-31c344047e35">
 Ruby SDK</a></li> <li data-lang="java"><a href="#tab-cbc5af80-c1b9-431a-a11d-a8cdbb7b2bb4">Java SDK</a></li> </ul> <div data-tab="PHP SDK" data-lang="php" id="tab-7c604a57-12d0-4202-a23f-4298592bda68"> (coming soon) </div> <div data-tab="Python SDK" data-lang="python" id="tab-82fa1414-2416-418f-8013-12f921c26b24"> <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-df5ba779-acb2-4b89-a3ce-2334d8066514">PHP SDK</a></li> <li data-lang="python"><a href="#tab-b3a6cd3d-a8df-4bb8-94cc-f51f9c6ef8fc">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-580ef14a-aa9a-48f5-871c-c81aee6e8bf9">
 Ruby SDK</a></li> <li data-lang="java"><a href="#tab-bc097fca-27c6-473f-8824-74d484efdbe7">Java SDK</a></li> </ul> <div data-tab="PHP SDK" data-lang="php" id="tab-df5ba779-acb2-4b89-a3ce-2334d8066514"> (coming soon) </div> <div data-tab="Python SDK" data-lang="python" id="tab-b3a6cd3d-a8df-4bb8-94cc-f51f9c6ef8fc"> <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-fcc14827-f55d-4a1f-b90b-31c344047e35"> (coming soon) </div> <div data-tab="Java SDK" data-lang="java" id="tab-cbc5af80-c1b9-431a-a11d-a8cdbb7b2bb4"> <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-580ef14a-aa9a-48f5-871c-c81aee6e8bf9"> (coming soon) </div> <div data-tab="Java SDK" data-lang="java" id="tab-bc097fca-27c6-473f-8824-74d484efdbe7"> <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-subscribe@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-subscribe@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-style="mega" data-count-href="/apache/predictionio/stargazers" data-count-api="/repos/apache/predictionio#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star apache/predictionio on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/predictionio/fork" data-icon="octicon-git-branch" data-style="mega" data-count-href="/apache/predictionio/network" data-count-api="/repos/apache/predictionio#forks_count" data-count-aria-label="# forks on GitHub" 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/ico
 ns/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/c17b9607/datacollection/channel/index.html
----------------------------------------------------------------------
diff --git a/datacollection/channel/index.html b/datacollection/channel/index.html
index ffefe92..0237a54 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 &quot;myChannel&quot; 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&amp;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 &gt;= 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 &quot;YOUR_CHANNEL&quot; of the corresponding App.</p><div class="tabs"> <ul class="control"> <li data-lang="bash"><a href="#tab-411a5b2a-9d82-4116-8f9d-a7aae4e77134">Raw HTTP</a></li> <li data-lang="php"><a href="#tab-8069d3ae-78e1-482e-a1b0-9731853f6946">PHP SDK</a></li> <li data-lang="python"><a href="#tab-526f56d1-af1c-42cf-9abd-bc075b8c45b2">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-43fdbd30-3e6e-484c-a9e9-1dcebb6bdb0d">Ruby SDK</a></li> <li data-lang="java"><a href
 ="#tab-076d251f-8352-4354-a75d-39a40d83ee65">Java SDK</a></li> </ul> <div data-tab="Raw HTTP" data-lang="bash" id="tab-411a5b2a-9d82-4116-8f9d-a7aae4e77134"> <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 &quot;myChannel&quot; 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&amp;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 &gt;= 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 &quot;YOUR_CHANNEL&quot; of the corresponding App.</p><div class="tabs"> <ul class="control"> <li data-lang="bash"><a href="#tab-9686b748-ff2d-44b0-b95e-b5b5f4ccf3e4">Raw HTTP</a></li> <li data-lang="php"><a href="#tab-fab4217e-3082-40d9-a73f-c87271c80cd6">PHP SDK</a></li> <li data-lang="python"><a href="#tab-02b989ec-2bbe-480c-a9d1-b0e9f70986cb">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-385486bf-65da-4434-941e-1a11044e7812">Ruby SDK</a></li> <li data-lang="java"><a href
 ="#tab-73e02180-ece3-41a4-8ec9-a2daae110ab4">Java SDK</a></li> </ul> <div data-tab="Raw HTTP" data-lang="bash" id="tab-9686b748-ff2d-44b0-b95e-b5b5f4ccf3e4"> <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-8069d3ae-78e1-482e-a1b0-9731853f6946"> (TODO: update me) </div> <div data-tab="Python SDK" data-lang="python" id="tab-526f56d1-af1c-42cf-9abd-bc075b8c45b2"> <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-fab4217e-3082-40d9-a73f-c87271c80cd6"> (TODO: update me) </div> <div data-tab="Python SDK" data-lang="python" id="tab-02b989ec-2bbe-480c-a9d1-b0e9f70986cb"> <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-43fdbd30-3e6e-484c-a9e9-1dcebb6bdb0d"> (TODO: update me) </div> <div data-tab="Java SDK" data-lang="java" id="tab-076d251f-8352-4354-a75d-39a40d83ee65"> <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-385486bf-65da-4434-941e-1a11044e7812"> (TODO: update me) </div> <div data-tab="Java SDK" data-lang="java" id="tab-73e02180-ece3-41a4-8ec9-a2daae110ab4"> <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 &lt;app name&gt; &lt;channel name&gt;
 </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 &lt;app name&gt; --channel &lt;channel name&gt;
 </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/c17b9607/datacollection/eventapi/index.html
----------------------------------------------------------------------
diff --git a/datacollection/eventapi/index.html b/datacollection/eventapi/index.html
index 11d06bb..a3d11db 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-9254a132-3543-4182-b2ce-0096535740e2">Raw HTTP</a></li> <li data-lang="php"><a href="#tab-8175256a-bb2e-49a8-8b2d-088fcd4827b2">PHP SDK</a></li> <li data-lang="python"><a href="#tab-afb752a5-9798-4204-b82b-6f185e9edc74">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-d942a8bf-3f09-46a2-beb3-065169b33edb">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-891e9834-c356-4b80-8dea-1cf78fac4fe1">Java SDK</a></li> </ul> <div data-tab="Raw HTTP" data-lang="bash" id="tab-
 9254a132-3543-4182-b2ce-0096535740e2"> <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-194583ac-c4b7-4a90-9874-b9757cf1b09f">Raw HTTP</a></li> <li data-lang="php"><a href="#tab-889d5a76-588b-48bc-8824-1115e0ab575a">PHP SDK</a></li> <li data-lang="python"><a href="#tab-5b17f7fa-8344-420e-bfa9-9cc082871842">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-8ee34816-1104-4047-b8bb-149b0b37dfbf">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-877e7d41-a0c2-40b9-9ae2-fca778e653ca">Java SDK</a></li> </ul> <div data-tab="Raw HTTP" data-lang="bash" id="tab-
 194583ac-c4b7-4a90-9874-b9757cf1b09f"> <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-8175256a-bb2e-49a8-8b2d-088fcd4827b2"> <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-889d5a76-588b-48bc-8824-1115e0ab575a"> <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">=&gt;</span> <span class="s1">'2004-12-13T21:39:45.618-07:00'</span>
                        <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-afb752a5-9798-4204-b82b-6f185e9edc74"> <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-5b17f7fa-8344-420e-bfa9-9cc082871842"> <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-d942a8bf-3f09-46a2-beb3-065169b33edb"> <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-8ee34816-1104-4047-b8bb-149b0b37dfbf"> <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">=&gt;</span> <span class="kp">true</span><span class="p">,</span>
                                             <span class="s1">'prop5'</span> <span class="o">=&gt;</span> <span class="sx">%w(a b c)</span><span class="p">,</span>
                                             <span class="s1">'prop6'</span> <span class="o">=&gt;</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-891e9834-c356-4b80-8dea-1cf78fac4fe1"> <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-cab5f84e-f1ea-49d7-a2c2-8561c777c27f">Raw HTTP</a></li> <li data-lang="php"><a href="#tab-06a74d76-2bc5-4bc6-a7df-92b5454d48e1">PHP SDK</a></li> <li data-lang="python"><a href="#tab-62ea118f-0f4d-4b25-a2ff-e0e03743b506">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-7a78f99f-b9af-4bde-a93b-8c1763b8f515">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-be138470-3758-45ed-b4fe-8de337fb4b51">Java SDK</a></li> </ul> <div data-tab="Raw HTTP" data-lang="bash" id="tab-cab5f84e-f1ea-49d7-a2c2-8561c777c27f"> <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-877e7d41-a0c2-40b9-9ae2-fca778e653ca"> <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-90f9e6a1-c4e5-4045-b1d4-054c0548ded5">Raw HTTP</a></li> <li data-lang="php"><a href="#tab-4f039be0-1b1a-4553-93db-b209d5aeb638">PHP SDK</a></li> <li data-lang="python"><a href="#tab-f86a98e9-1609-4305-90b6-2e02eca636d9">Python SDK</a></li> <li data-lang="ruby"><a href="#tab-e6ace4c5-8c1d-4fc1-a13d-05cc1189a850">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-19761dc1-3e13-4f7d-9c36-2e3febda7dae">Java SDK</a></li> </ul> <div data-tab="Raw HTTP" data-lang="bash" id="tab-90f9e6a1-c4e5-4045-b1d4-054c0548ded5"> <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-06a74d76-2bc5-4bc6-a7df-92b5454d48e1"> <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-4f039be0-1b1a-4553-93db-b209d5aeb638"> <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">=&gt;</span> <span class="s1">'2004-12-13T21:39:45.618Z'</span>
                        <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-62ea118f-0f4d-4b25-a2ff-e0e03743b506"> <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-f86a98e9-1609-4305-90b6-2e02eca636d9"> <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-7a78f99f-b9af-4bde-a93b-8c1763b8f515"> <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-e6ace4c5-8c1d-4fc1-a13d-05cc1189a850"> <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">=&gt;</span> <span class="s1">'2004-12-13T21:39:45.618Z'</span><span class="p">,</span>
                           <span class="s1">'properties'</span> <span class="o">=&gt;</span> <span class="p">{</span> <span class="s1">'someProperty'</span> <span class="o">=&gt;</span> <span class="s1">'value1'</span><span class="p">,</span>
                                             <span class="s1">'anotherProperty'</span> <span class="o">=&gt;</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-be138470-3758-45ed-b4fe-8de337fb4b51"> <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-19761dc1-3e13-4f7d-9c36-2e3febda7dae"> <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

http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/deploy/index.html
----------------------------------------------------------------------
diff --git a/deploy/index.html b/deploy/index.html
index 2514a17..fcc6ce1 100644
--- a/deploy/index.html
+++ b/deploy/index.html
@@ -4,7 +4,7 @@
 </pre></td></tr></tbody></table> </div> <p>For example, if you want to re-train the model every day, you may add this to your <em>crontab</em>:</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>0 0 <span class="k">*</span> <span class="k">*</span> <span class="k">*</span>   <span class="nv">$PIO_HOME</span>/bin/pio train; <span class="nv">$PIO_HOME</span>/bin/pio deploy
 </pre></td></tr></tbody></table> </div> <p>where <em>$PIO_HOME</em> is the installation path of PredictionIO. See <a href="#retrain-and-deploy-script">Retrain and Deploy Script</a> below for a script ready for customization.</p><h2 id='specify-a-different-engine-port' class='header-anchors'>Specify a Different Engine Port</h2><p>By default, <code>pio deploy</code> deploys an engine on <strong>port 8000</strong>.</p><p>You can specify another port with an <em>--port</em> argument. For example, to deploy on port 8123</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>pio deploy --port 8123
 </pre></td></tr></tbody></table> </div> <p>You can also specify the binding IP with <em>--ip</em>, which is set to <em>localhost</em> if not specified. For example:</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>pio deploy --port 8123 --ip 1.2.3.4
-</pre></td></tr></tbody></table> </div> <h2 id='retrain-and-deploy-script' class='header-anchors'>Retrain and Deploy Script</h2><p>A retrain and deploy script is available <a href="https://github.com/apache/predictionio/tree/develop/examples/redeploy-script">in the <em>examples/redeploy-script</em> directory</a>.</p><p>To use the script, copy <em>local.sh.template</em> as <em>local.sh</em>, <em>redeploy.sh</em> as (say) <em>MyEngine_Redeploy_(production).sh</em> (Name of the script will appear as title of email) and put both files under the <em>scripts/</em> directory of your engine. Then, modify the settings inside both file, filling in details like <code>PIO_HOME</code>, <code>LOG_DIR</code>, <code>TARGET_EMAIL</code>, <code>ENGINE_JSON</code> and others. You need to do <code>pio build</code> once before using this script. This script only trains and deploys. If <code>pio train</code> or <code>pio deploy</code> fails for some reason, the running engine stays put in most cases. If 
 engine is retrained and deployed successfully, the email sent will have <em>Normal</em> in the title so you can set filtering rules.</p><p><code>mailutils</code> is used in this script. For Ubuntu, you can do <code>sudo update-alternatives --config mailx</code> and see if <code>/usr/bin/mail.mailutils</code> is selected. If you are using a server that blocks email, you will need to use services like SendGrid.</p><p>This script does not guarantee no down time since at some point during <code>pio deploy</code> the original engine is shut down. The down time is usually not more than a few seconds though it can be more.</p><p>The last thing to do is to add this to your <em>crontab</em>:</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>0 0 <span class="k">*</span> <span class="k">*</span> <span class="k">*</span>   /path/to/script &gt;/dev/null 2&gt;/dev/null <
 span class="c"># mute both stdout and stderr to supress email sent from cron</span>
+</pre></td></tr></tbody></table> </div> <h2 id='retrain-and-deploy-script' class='header-anchors'>Retrain and Deploy Script</h2><p>A retrain and deploy script is available <a href="https://github.com/apache/predictionio/tree/develop/examples/redeploy-script">in the <em>examples/redeploy-script</em> directory</a>.</p><p>To use the script, copy <em>local.sh.template</em> as <em>local.sh</em>, <em>redeploy.sh</em> as (say) <em>MyEngine_Redeploy_(production).sh</em> (Name of the script will appear as title of email) and put both files under the <em>scripts/</em> directory of your engine. Then, modify the settings inside both file, filling in details like <code>PIO_HOME</code>, <code>LOG_DIR</code>, <code>TARGET_EMAIL</code>, <code>ENGINE_JSON</code> and others. You need to do <code>pio build</code> once before using this script. This script only trains and deploys. If <code>pio train</code> or <code>pio deploy</code> fails for some reason, the running engine stays put in most cases. If 
 engine is retrained and deployed successfully, the email sent will have <em>Normal</em> in the title so you can set filtering rules.</p><p><code>mailutils</code> is used in this script. For Ubuntu, you can do <code>sudo update-alternatives --config mailx</code> and see if <code>/usr/bin/mail.mailutils</code> is selected. If you are using a server that blocks email, you will need to use services like SendGrid.</p><p>This script does not guarantee no down time since at some point during <code>pio deploy</code> the original engine is shut down. The down time is usually not more than a few seconds though it can be more.</p><p>The last thing to do is to add this to your <em>crontab</em>:</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>0 0 <span class="k">*</span> <span class="k">*</span> <span class="k">*</span>   /path/to/script &gt;/dev/null 2&gt;/dev/null <
 span class="c"># mute both stdout and stderr to suppress email sent from cron</span>
 </pre></td></tr></tbody></table> </div> </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-subscribe@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/contribute-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-subscribe@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="social-icons-wrapper"><a class="github-button" href="https://github.com/apache/predictionio" data-style="mega" data-count-href="/apache/predictionio/s
 targazers" data-count-api="/repos/apache/predictionio#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star apache/predictionio on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/predictionio/fork" data-icon="octicon-git-branch" data-style="mega" data-count-href="/apache/predictionio/network" data-count-api="/repos/apache/predictionio#forks_count" data-count-aria-label="# forks on GitHub" 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]||fu
 nction(){
 (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
 e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);

http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/evaluation/metricbuild/index.html
----------------------------------------------------------------------
diff --git a/evaluation/metricbuild/index.html b/evaluation/metricbuild/index.html
index 75a5bc9..f9fb74e 100644
--- a/evaluation/metricbuild/index.html
+++ b/evaluation/metricbuild/index.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><title>Building Evaluation Metrics</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Building Evaluation Metrics"/><link rel="canonical" href="https://predictionio.apache.org/evaluation/metricbuild/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><script src="//cdn.mathjax.or
 g/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="search-bar-row-wrapper"><div class="container-fluid" id="search-bar-row"><div class="row"><div class="col-md-9 col-sm-11 col-xs-11"
 ><div class="hidden-md hidden-lg" id="mobile-page-heading-wrapper"><p>PredictionIO Docs</p><h4>Building Evaluation Metrics</h4></div><h4 class="hidden-sm hidden-xs">PredictionIO Docs</h4></div><div class="col-md-3 col-sm-1 col-xs-1 hidden-md hidden-lg"><img id="left-menu-indicator" src="/images/icons/down-arrow-dfe9f7fe.png"/></div><div class="col-md-3 col-sm-12 col-xs-12 swiftype-wrapper"><div class="swiftype"><form class="search-form"><img class="search-box-toggler hidden-xs hidden-sm" src="/images/icons/search-glass-704bd4ff.png"/><div class="search-box"><img src="/images/icons/search-glass-704bd4ff.png"/><input type="text" id="st-search-input" class="st-search-input" placeholder="Search Doc..."/></div><img class="swiftype-row-hider hidden-md hidden-lg" src="/images/icons/drawer-toggle-active-fcbef12a.png"/></form></div></div><div class="mobile-left-menu-toggler hidden-md hidden-lg"></div></div></div></div><div id="page" class="container-fluid"><div class="row"><div id="left-menu
 -wrapper" class="col-md-3"><nav id="nav-main"><ul><li class="level-1"><a class="expandible" href="/"><span>Apache PredictionIO® Documentation</span></a><ul><li class="level-2"><a class="final" href="/"><span>Welcome to Apache PredictionIO®</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Started</span></a><ul><li class="level-2"><a class="final" href="/start/"><span>A Quick Intro</span></a></li><li class="level-2"><a class="final" href="/install/"><span>Installing Apache PredictionIO</span></a></li><li class="level-2"><a class="final" href="/start/download/"><span>Downloading an Engine Template</span></a></li><li class="level-2"><a class="final" href="/start/deploy/"><span>Deploying Your First Engine</span></a></li><li class="level-2"><a class="final" href="/start/customize/"><span>Customizing the Engine</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Integrating with Your App</span></a><ul><li class="level
 -2"><a class="final" href="/appintegration/"><span>App Integration Overview</span></a></li><li class="level-2"><a class="expandible" href="/sdk/"><span>List of SDKs</span></a><ul><li class="level-3"><a class="final" href="/sdk/java/"><span>Java & Android SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/php/"><span>PHP SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/python/"><span>Python SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/ruby/"><span>Ruby SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/community/"><span>Community Powered SDKs</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Deploying an Engine</span></a><ul><li class="level-2"><a class="final" href="/deploy/"><span>Deploying as a Web Service</span></a></li><li class="level-2"><a class="final" href="/batchpredict/"><span>Batch Predictions</span></a></li><li class="level-2"><a class="final" href="/deploy/m
 onitoring/"><span>Monitoring Engine</span></a></li><li class="level-2"><a class="final" href="/deploy/engineparams/"><span>Setting Engine Parameters</span></a></li><li class="level-2"><a class="final" href="/deploy/enginevariants/"><span>Deploying Multiple Engine Variants</span></a></li><li class="level-2"><a class="final" href="/deploy/plugin/"><span>Engine Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Customizing an Engine</span></a><ul><li class="level-2"><a class="final" href="/customize/"><span>Learning DASE</span></a></li><li class="level-2"><a class="final" href="/customize/dase/"><span>Implement DASE</span></a></li><li class="level-2"><a class="final" href="/customize/troubleshooting/"><span>Troubleshooting Engine Development</span></a></li><li class="level-2"><a class="final" href="/api/current/#package"><span>Engine Scala APIs</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Collecting and A
 nalyzing Data</span></a><ul><li class="level-2"><a class="final" href="/datacollection/"><span>Event Server Overview</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventapi/"><span>Collecting Data with REST/SDKs</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventmodel/"><span>Events Modeling</span></a></li><li class="level-2"><a class="final" href="/datacollection/webhooks/"><span>Unifying Multichannel Data with Webhooks</span></a></li><li class="level-2"><a class="final" href="/datacollection/channel/"><span>Channel</span></a></li><li class="level-2"><a class="final" href="/datacollection/batchimport/"><span>Importing Data in Batch</span></a></li><li class="level-2"><a class="final" href="/datacollection/analytics/"><span>Using Analytics Tools</span></a></li><li class="level-2"><a class="final" href="/datacollection/plugin/"><span>Event Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><s
 pan>Choosing an Algorithm(s)</span></a><ul><li class="level-2"><a class="final" href="/algorithm/"><span>Built-in Algorithm Libraries</span></a></li><li class="level-2"><a class="final" href="/algorithm/switch/"><span>Switching to Another Algorithm</span></a></li><li class="level-2"><a class="final" href="/algorithm/multiple/"><span>Combining Multiple Algorithms</span></a></li><li class="level-2"><a class="final" href="/algorithm/custom/"><span>Adding Your Own Algorithms</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>ML Tuning and Evaluation</span></a><ul><li class="level-2"><a class="final" href="/evaluation/"><span>Overview</span></a></li><li class="level-2"><a class="final" href="/evaluation/paramtuning/"><span>Hyperparameter Tuning</span></a></li><li class="level-2"><a class="final" href="/evaluation/evaluationdashboard/"><span>Evaluation Dashboard</span></a></li><li class="level-2"><a class="final" href="/evaluation/metricchoose/"><span>Choosi
 ng Evaluation Metrics</span></a></li><li class="level-2"><a class="final active" href="/evaluation/metricbuild/"><span>Building Evaluation Metrics</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>System Architecture</span></a><ul><li class="level-2"><a class="final" href="/system/"><span>Architecture Overview</span></a></li><li class="level-2"><a class="final" href="/system/anotherdatastore/"><span>Using Another Data Store</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>PredictionIO® Official Templates</span></a><ul><li class="level-2"><a class="final" href="/templates/"><span>Intro</span></a></li><li class="level-2"><a class="expandible" href="#"><span>Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/recommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/dase/"><span>DASE</span></a></li><li class="level-3"><
 a class="final" href="/templates/recommendation/evaluation/"><span>Evaluation Explained</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/reading-custom-events/"><span>Read Custom Events</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-data-prep/"><span>Customize Data Preparator</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-serving/"><span>Customize Serving</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/training-with-implicit-preference/"><span>Train with Implicit Preference</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/blacklist-items/"><span>Filter Recommended Items by Blacklist in Query</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/batch-ev
 aluator/"><span>Batch Persistable Evaluator</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>E-Commerce Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/adjust-score/"><span>Adjust Score</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Similar Product</span></a><ul><li class="level-3"><a class="final" href="/templates/similarproduct/quickstart/"><span>Quick Start</span></a></
 li><li class="level-3"><a class="final" href="/templates/similarproduct/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/multi-events-multi-algos/"><span>Multiple Events and Multiple Algorithms</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/return-item-properties/"><span>Returns Item Properties</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/rid-user-set-event/"><span>Get Rid of Events for Users</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/recommended-user/"><span>Recommend Users</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Classification</span></
 a><ul><li class="level-3"><a class="final" href="/templates/classification/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/classification/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/classification/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/classification/add-algorithm/"><span>Use Alternative Algorithm</span></a></li><li class="level-3"><a class="final" href="/templates/classification/reading-custom-properties/"><span>Read Custom Properties</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Engine Template Gallery</span></a><ul><li class="level-2"><a class="final" href="/gallery/template-gallery/"><span>Browse</span></a></li><li class="level-2"><a class="final" href="/community/submit-template/"><span>Submit your Engine as a Template</span></a></li></ul></li><li class="level-1"><a class="expandible" hre
 f="#"><span>Demo Tutorials</span></a><ul><li class="level-2"><a class="final" href="/demo/tapster/"><span>Comics Recommendation Demo</span></a></li><li class="level-2"><a class="final" href="/demo/community/"><span>Community Contributed Demo</span></a></li><li class="level-2"><a class="final" href="/demo/textclassification/"><span>Text Classification Engine Tutorial</span></a></li></ul></li><li class="level-1"><a class="expandible" href="/community/"><span>Getting Involved</span></a><ul><li class="level-2"><a class="final" href="/community/contribute-code/"><span>Contribute Code</span></a></li><li class="level-2"><a class="final" href="/community/contribute-documentation/"><span>Contribute Documentation</span></a></li><li class="level-2"><a class="final" href="/community/contribute-sdk/"><span>Contribute a SDK</span></a></li><li class="level-2"><a class="final" href="/community/contribute-webhook/"><span>Contribute a Webhook</span></a></li><li class="level-2"><a class="final" href="
 /community/projects/"><span>Community Projects</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Help</span></a><ul><li class="level-2"><a class="final" href="/resources/faq/"><span>FAQs</span></a></li><li class="level-2"><a class="final" href="/support/"><span>Support</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Resources</span></a><ul><li class="level-2"><a class="final" href="/cli/"><span>Command-line Interface</span></a></li><li class="level-2"><a class="final" href="/resources/release/"><span>Release Cadence</span></a></li><li class="level-2"><a class="final" href="/resources/intellij/"><span>Developing Engines with IntelliJ IDEA</span></a></li><li class="level-2"><a class="final" href="/resources/upgrade/"><span>Upgrade Instructions</span></a></li><li class="level-2"><a class="final" href="/resources/glossary/"><span>Glossary</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#">
 <span>Apache Software Foundation</span></a><ul><li class="level-2"><a class="final" href="https://www.apache.org/"><span>Apache Homepage</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/licenses/"><span>License</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/sponsorship.html"><span>Sponsorship</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/thanks.html"><span>Thanks</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/security/"><span>Security</span></a></li></ul></li></ul></nav></div><div class="col-md-9 col-sm-12"><div class="content-header hidden-md hidden-lg"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">ML Tuning and Evaluation</a><span class="spacer">&gt;</span></li><li><span class="last">Building Evaluation Metrics</span></li></ul></div><div id="page-title"><h1>Building Evaluation Metrics</h1></div></div><d
 iv id="table-of-content-wrapper"><h5>On this page</h5><aside id="table-of-contents"><ul> <li> <a href="#overview">Overview</a> </li> <li> <a href="#example-1-accuracy-metric">Example 1: Accuracy Metric</a> </li> <li> <a href="#example-2-precision-metric">Example 2: Precision Metric</a> </li> </ul> </aside><hr/><a id="edit-page-link" href="https://github.com/apache/predictionio/tree/livedoc/docs/manual/source/evaluation/metricbuild.html.md"><img src="/images/icons/edit-pencil-d6c1bb3d.png"/>Edit this page</a></div><div class="content-header hidden-sm hidden-xs"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">ML Tuning and Evaluation</a><span class="spacer">&gt;</span></li><li><span class="last">Building Evaluation Metrics</span></li></ul></div><div id="page-title"><h1>Building Evaluation Metrics</h1></div></div><div class="content"> <p>PredictionIO enables developer to implement evaluation custom evaluation metric with just a few lines of code. We illustrate it 
 with <a href="/templates/classification/quickstart/">the classification template</a>.</p><h2 id='overview' class='header-anchors'>Overview</h2><p>A simplistic form of metric is a function which takes a <code>(Query, PredictedResult, ActualResult)</code>-tuple (<em>QPA-tuple</em>) as input and return a score. Exploiting this properties allows us to implement custom metric with a single line of code (plus some boilerplates). We demonstate this with two metrics: accuracy and precision.</p> <h2 id='example-1:-accuracy-metric' class='header-anchors'>Example 1: Accuracy Metric</h2><p>Accuracy is a metric capturing the portion of correct prediction among all test data points. A way to model this is for each correct QPA-tuple, we give a score of 1.0 and otherwise 0.0, then we take an average of all tuple scores.</p><p>PredictionIO has a [[AverageMetric]] helper class which provides this feature. This class takes 4 type parameters, [[EvalInfo]], [[Query]], [[PredictedResult]], and [[ActualRe
 sult]], these types can be found from the engine&#39;s signature. Line 5 below is the custom calculation.</p><div class="highlight scala"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1
+<!DOCTYPE html><html><head><title>Building Evaluation Metrics</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Building Evaluation Metrics"/><link rel="canonical" href="https://predictionio.apache.org/evaluation/metricbuild/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><script src="//cdn.mathjax.or
 g/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="search-bar-row-wrapper"><div class="container-fluid" id="search-bar-row"><div class="row"><div class="col-md-9 col-sm-11 col-xs-11"
 ><div class="hidden-md hidden-lg" id="mobile-page-heading-wrapper"><p>PredictionIO Docs</p><h4>Building Evaluation Metrics</h4></div><h4 class="hidden-sm hidden-xs">PredictionIO Docs</h4></div><div class="col-md-3 col-sm-1 col-xs-1 hidden-md hidden-lg"><img id="left-menu-indicator" src="/images/icons/down-arrow-dfe9f7fe.png"/></div><div class="col-md-3 col-sm-12 col-xs-12 swiftype-wrapper"><div class="swiftype"><form class="search-form"><img class="search-box-toggler hidden-xs hidden-sm" src="/images/icons/search-glass-704bd4ff.png"/><div class="search-box"><img src="/images/icons/search-glass-704bd4ff.png"/><input type="text" id="st-search-input" class="st-search-input" placeholder="Search Doc..."/></div><img class="swiftype-row-hider hidden-md hidden-lg" src="/images/icons/drawer-toggle-active-fcbef12a.png"/></form></div></div><div class="mobile-left-menu-toggler hidden-md hidden-lg"></div></div></div></div><div id="page" class="container-fluid"><div class="row"><div id="left-menu
 -wrapper" class="col-md-3"><nav id="nav-main"><ul><li class="level-1"><a class="expandible" href="/"><span>Apache PredictionIO® Documentation</span></a><ul><li class="level-2"><a class="final" href="/"><span>Welcome to Apache PredictionIO®</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Started</span></a><ul><li class="level-2"><a class="final" href="/start/"><span>A Quick Intro</span></a></li><li class="level-2"><a class="final" href="/install/"><span>Installing Apache PredictionIO</span></a></li><li class="level-2"><a class="final" href="/start/download/"><span>Downloading an Engine Template</span></a></li><li class="level-2"><a class="final" href="/start/deploy/"><span>Deploying Your First Engine</span></a></li><li class="level-2"><a class="final" href="/start/customize/"><span>Customizing the Engine</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Integrating with Your App</span></a><ul><li class="level
 -2"><a class="final" href="/appintegration/"><span>App Integration Overview</span></a></li><li class="level-2"><a class="expandible" href="/sdk/"><span>List of SDKs</span></a><ul><li class="level-3"><a class="final" href="/sdk/java/"><span>Java & Android SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/php/"><span>PHP SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/python/"><span>Python SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/ruby/"><span>Ruby SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/community/"><span>Community Powered SDKs</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Deploying an Engine</span></a><ul><li class="level-2"><a class="final" href="/deploy/"><span>Deploying as a Web Service</span></a></li><li class="level-2"><a class="final" href="/batchpredict/"><span>Batch Predictions</span></a></li><li class="level-2"><a class="final" href="/deploy/m
 onitoring/"><span>Monitoring Engine</span></a></li><li class="level-2"><a class="final" href="/deploy/engineparams/"><span>Setting Engine Parameters</span></a></li><li class="level-2"><a class="final" href="/deploy/enginevariants/"><span>Deploying Multiple Engine Variants</span></a></li><li class="level-2"><a class="final" href="/deploy/plugin/"><span>Engine Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Customizing an Engine</span></a><ul><li class="level-2"><a class="final" href="/customize/"><span>Learning DASE</span></a></li><li class="level-2"><a class="final" href="/customize/dase/"><span>Implement DASE</span></a></li><li class="level-2"><a class="final" href="/customize/troubleshooting/"><span>Troubleshooting Engine Development</span></a></li><li class="level-2"><a class="final" href="/api/current/#package"><span>Engine Scala APIs</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Collecting and A
 nalyzing Data</span></a><ul><li class="level-2"><a class="final" href="/datacollection/"><span>Event Server Overview</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventapi/"><span>Collecting Data with REST/SDKs</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventmodel/"><span>Events Modeling</span></a></li><li class="level-2"><a class="final" href="/datacollection/webhooks/"><span>Unifying Multichannel Data with Webhooks</span></a></li><li class="level-2"><a class="final" href="/datacollection/channel/"><span>Channel</span></a></li><li class="level-2"><a class="final" href="/datacollection/batchimport/"><span>Importing Data in Batch</span></a></li><li class="level-2"><a class="final" href="/datacollection/analytics/"><span>Using Analytics Tools</span></a></li><li class="level-2"><a class="final" href="/datacollection/plugin/"><span>Event Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><s
 pan>Choosing an Algorithm(s)</span></a><ul><li class="level-2"><a class="final" href="/algorithm/"><span>Built-in Algorithm Libraries</span></a></li><li class="level-2"><a class="final" href="/algorithm/switch/"><span>Switching to Another Algorithm</span></a></li><li class="level-2"><a class="final" href="/algorithm/multiple/"><span>Combining Multiple Algorithms</span></a></li><li class="level-2"><a class="final" href="/algorithm/custom/"><span>Adding Your Own Algorithms</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>ML Tuning and Evaluation</span></a><ul><li class="level-2"><a class="final" href="/evaluation/"><span>Overview</span></a></li><li class="level-2"><a class="final" href="/evaluation/paramtuning/"><span>Hyperparameter Tuning</span></a></li><li class="level-2"><a class="final" href="/evaluation/evaluationdashboard/"><span>Evaluation Dashboard</span></a></li><li class="level-2"><a class="final" href="/evaluation/metricchoose/"><span>Choosi
 ng Evaluation Metrics</span></a></li><li class="level-2"><a class="final active" href="/evaluation/metricbuild/"><span>Building Evaluation Metrics</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>System Architecture</span></a><ul><li class="level-2"><a class="final" href="/system/"><span>Architecture Overview</span></a></li><li class="level-2"><a class="final" href="/system/anotherdatastore/"><span>Using Another Data Store</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>PredictionIO® Official Templates</span></a><ul><li class="level-2"><a class="final" href="/templates/"><span>Intro</span></a></li><li class="level-2"><a class="expandible" href="#"><span>Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/recommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/dase/"><span>DASE</span></a></li><li class="level-3"><
 a class="final" href="/templates/recommendation/evaluation/"><span>Evaluation Explained</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/reading-custom-events/"><span>Read Custom Events</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-data-prep/"><span>Customize Data Preparator</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-serving/"><span>Customize Serving</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/training-with-implicit-preference/"><span>Train with Implicit Preference</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/blacklist-items/"><span>Filter Recommended Items by Blacklist in Query</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/batch-ev
 aluator/"><span>Batch Persistable Evaluator</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>E-Commerce Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/adjust-score/"><span>Adjust Score</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Similar Product</span></a><ul><li class="level-3"><a class="final" href="/templates/similarproduct/quickstart/"><span>Quick Start</span></a></
 li><li class="level-3"><a class="final" href="/templates/similarproduct/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/multi-events-multi-algos/"><span>Multiple Events and Multiple Algorithms</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/return-item-properties/"><span>Returns Item Properties</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/rid-user-set-event/"><span>Get Rid of Events for Users</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/recommended-user/"><span>Recommend Users</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Classification</span></
 a><ul><li class="level-3"><a class="final" href="/templates/classification/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/classification/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/classification/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/classification/add-algorithm/"><span>Use Alternative Algorithm</span></a></li><li class="level-3"><a class="final" href="/templates/classification/reading-custom-properties/"><span>Read Custom Properties</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Engine Template Gallery</span></a><ul><li class="level-2"><a class="final" href="/gallery/template-gallery/"><span>Browse</span></a></li><li class="level-2"><a class="final" href="/community/submit-template/"><span>Submit your Engine as a Template</span></a></li></ul></li><li class="level-1"><a class="expandible" hre
 f="#"><span>Demo Tutorials</span></a><ul><li class="level-2"><a class="final" href="/demo/tapster/"><span>Comics Recommendation Demo</span></a></li><li class="level-2"><a class="final" href="/demo/community/"><span>Community Contributed Demo</span></a></li><li class="level-2"><a class="final" href="/demo/textclassification/"><span>Text Classification Engine Tutorial</span></a></li></ul></li><li class="level-1"><a class="expandible" href="/community/"><span>Getting Involved</span></a><ul><li class="level-2"><a class="final" href="/community/contribute-code/"><span>Contribute Code</span></a></li><li class="level-2"><a class="final" href="/community/contribute-documentation/"><span>Contribute Documentation</span></a></li><li class="level-2"><a class="final" href="/community/contribute-sdk/"><span>Contribute a SDK</span></a></li><li class="level-2"><a class="final" href="/community/contribute-webhook/"><span>Contribute a Webhook</span></a></li><li class="level-2"><a class="final" href="
 /community/projects/"><span>Community Projects</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Help</span></a><ul><li class="level-2"><a class="final" href="/resources/faq/"><span>FAQs</span></a></li><li class="level-2"><a class="final" href="/support/"><span>Support</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Resources</span></a><ul><li class="level-2"><a class="final" href="/cli/"><span>Command-line Interface</span></a></li><li class="level-2"><a class="final" href="/resources/release/"><span>Release Cadence</span></a></li><li class="level-2"><a class="final" href="/resources/intellij/"><span>Developing Engines with IntelliJ IDEA</span></a></li><li class="level-2"><a class="final" href="/resources/upgrade/"><span>Upgrade Instructions</span></a></li><li class="level-2"><a class="final" href="/resources/glossary/"><span>Glossary</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#">
 <span>Apache Software Foundation</span></a><ul><li class="level-2"><a class="final" href="https://www.apache.org/"><span>Apache Homepage</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/licenses/"><span>License</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/sponsorship.html"><span>Sponsorship</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/thanks.html"><span>Thanks</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/security/"><span>Security</span></a></li></ul></li></ul></nav></div><div class="col-md-9 col-sm-12"><div class="content-header hidden-md hidden-lg"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">ML Tuning and Evaluation</a><span class="spacer">&gt;</span></li><li><span class="last">Building Evaluation Metrics</span></li></ul></div><div id="page-title"><h1>Building Evaluation Metrics</h1></div></div><d
 iv id="table-of-content-wrapper"><h5>On this page</h5><aside id="table-of-contents"><ul> <li> <a href="#overview">Overview</a> </li> <li> <a href="#example-1-accuracy-metric">Example 1: Accuracy Metric</a> </li> <li> <a href="#example-2-precision-metric">Example 2: Precision Metric</a> </li> </ul> </aside><hr/><a id="edit-page-link" href="https://github.com/apache/predictionio/tree/livedoc/docs/manual/source/evaluation/metricbuild.html.md"><img src="/images/icons/edit-pencil-d6c1bb3d.png"/>Edit this page</a></div><div class="content-header hidden-sm hidden-xs"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">ML Tuning and Evaluation</a><span class="spacer">&gt;</span></li><li><span class="last">Building Evaluation Metrics</span></li></ul></div><div id="page-title"><h1>Building Evaluation Metrics</h1></div></div><div class="content"> <p>PredictionIO enables developer to implement evaluation custom evaluation metric with just a few lines of code. We illustrate it 
 with <a href="/templates/classification/quickstart/">the classification template</a>.</p><h2 id='overview' class='header-anchors'>Overview</h2><p>A simplistic form of metric is a function which takes a <code>(Query, PredictedResult, ActualResult)</code>-tuple (<em>QPA-tuple</em>) as input and return a score. Exploiting this properties allows us to implement custom metric with a single line of code (plus some boilerplates). We demonstrate this with two metrics: accuracy and precision.</p> <h2 id='example-1:-accuracy-metric' class='header-anchors'>Example 1: Accuracy Metric</h2><p>Accuracy is a metric capturing the portion of correct prediction among all test data points. A way to model this is for each correct QPA-tuple, we give a score of 1.0 and otherwise 0.0, then we take an average of all tuple scores.</p><p>PredictionIO has a [[AverageMetric]] helper class which provides this feature. This class takes 4 type parameters, [[EvalInfo]], [[Query]], [[PredictedResult]], and [[ActualR
 esult]], these types can be found from the engine&#39;s signature. Line 5 below is the custom calculation.</p><div class="highlight scala"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -16,7 +16,7 @@
 ...
 <span class="gp">$ </span>pio <span class="nb">eval </span>org.example.classification.AccuracyEvaluation org.example.classification.EngineParamsList
 ...
-</pre></td></tr></tbody></table> </div> <p>(See MyClassification/src/main/scala/<strong><em>Evaluation.scala</em></strong> for full usage.)</p><h2 id='example-2:-precision-metric' class='header-anchors'>Example 2: Precision Metric</h2><p>Precision is a metric for binary classifier capturing the portion of correction prediction among all <em>positive</em> predictions. We don&#39;t care about the cases where the QPA-tuple gives a negative prediction. (Recall that a binary classifier only provide two output values: <em>positive</em> and <em>negative</em>.) The following table illustrates all four cases:</p> <table><thead> <tr> <th style="text-align: center">PredictedResult</th> <th style="text-align: center">ActualResult</th> <th style="text-align: center">Value</th> </tr> </thead><tbody> <tr> <td style="text-align: center">Positive</td> <td style="text-align: center">Positive</td> <td style="text-align: center">1.0</td> </tr> <tr> <td style="text-align: center">Positive</td> <td style
 ="text-align: center">Negative</td> <td style="text-align: center">0.0</td> </tr> <tr> <td style="text-align: center">Negative</td> <td style="text-align: center">Positive</td> <td style="text-align: center">Don&#39;t care</td> </tr> <tr> <td style="text-align: center">Negative</td> <td style="text-align: center">Negative</td> <td style="text-align: center">Don&#39;t care</td> </tr> </tbody></table> <p>Calculating the precision metric is a slightly more involved procedure than calculating the accuracy metric as we have to specially handle the <em>don&#39;t care</em> negative cases.</p><p>PredictionIO provides a helper class <code>OptionAverageMetric</code> allows user to specify <em>don&#39;t care</em> values as <code>None</code>. It only aggregates the non-None values. Lines 3 to 4 is the method signature of <code>calcuate</code> method. The key difference is that the return value is a <code>Option[Double]</code>, in contrast to <code>Double</code> for <code>AverageMetric</code>. T
 his class only computes the average of <code>Some(.)</code> results. Lines 5 to 13 are the actual logic. The first <code>if</code> factors out the positively predicted case, and the computation is simliar to the accuracy metric. The negatively predicted case are the <em>don&#39;t cares</em>, which we return <code>None</code>.</p><div class="highlight scala"><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>(See MyClassification/src/main/scala/<strong><em>Evaluation.scala</em></strong> for full usage.)</p><h2 id='example-2:-precision-metric' class='header-anchors'>Example 2: Precision Metric</h2><p>Precision is a metric for binary classifier capturing the portion of correction prediction among all <em>positive</em> predictions. We don&#39;t care about the cases where the QPA-tuple gives a negative prediction. (Recall that a binary classifier only provide two output values: <em>positive</em> and <em>negative</em>.) The following table illustrates all four cases:</p> <table><thead> <tr> <th style="text-align: center">PredictedResult</th> <th style="text-align: center">ActualResult</th> <th style="text-align: center">Value</th> </tr> </thead><tbody> <tr> <td style="text-align: center">Positive</td> <td style="text-align: center">Positive</td> <td style="text-align: center">1.0</td> </tr> <tr> <td style="text-align: center">Positive</td> <td style
 ="text-align: center">Negative</td> <td style="text-align: center">0.0</td> </tr> <tr> <td style="text-align: center">Negative</td> <td style="text-align: center">Positive</td> <td style="text-align: center">Don&#39;t care</td> </tr> <tr> <td style="text-align: center">Negative</td> <td style="text-align: center">Negative</td> <td style="text-align: center">Don&#39;t care</td> </tr> </tbody></table> <p>Calculating the precision metric is a slightly more involved procedure than calculating the accuracy metric as we have to specially handle the <em>don&#39;t care</em> negative cases.</p><p>PredictionIO provides a helper class <code>OptionAverageMetric</code> allows user to specify <em>don&#39;t care</em> values as <code>None</code>. It only aggregates the non-None values. Lines 3 to 4 is the method signature of <code>calcuate</code> method. The key difference is that the return value is a <code>Option[Double]</code>, in contrast to <code>Double</code> for <code>AverageMetric</code>. T
 his class only computes the average of <code>Some(.)</code> results. Lines 5 to 13 are the actual logic. The first <code>if</code> factors out the positively predicted case, and the computation is similiar to the accuracy metric. The negatively predicted case are the <em>don&#39;t cares</em>, which we return <code>None</code>.</p><div class="highlight scala"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4


[03/11] predictionio-site git commit: Documentation based on apache/predictionio#54415e1066ae2d646eef62ebfdf801ace1de2097

Posted by gi...@apache.org.
http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/templates/recommendation/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/recommendation/quickstart/index.html b/templates/recommendation/quickstart/index.html
index 88d4532..8523ab8 100644
--- a/templates/recommendation/quickstart/index.html
+++ b/templates/recommendation/quickstart/index.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><title>Quick Start - Recommendation Engine Template</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Quick Start - Recommendation Engine Template"/><link rel="canonical" href="https://predictionio.apache.org/templates/recommendation/quickstart/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv
 .min.js"></script><script src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="search-bar-row-wrapper"><div class="container-fluid" id="search-bar-row"><div class=
 "row"><div class="col-md-9 col-sm-11 col-xs-11"><div class="hidden-md hidden-lg" id="mobile-page-heading-wrapper"><p>PredictionIO Docs</p><h4>Quick Start - Recommendation Engine Template</h4></div><h4 class="hidden-sm hidden-xs">PredictionIO Docs</h4></div><div class="col-md-3 col-sm-1 col-xs-1 hidden-md hidden-lg"><img id="left-menu-indicator" src="/images/icons/down-arrow-dfe9f7fe.png"/></div><div class="col-md-3 col-sm-12 col-xs-12 swiftype-wrapper"><div class="swiftype"><form class="search-form"><img class="search-box-toggler hidden-xs hidden-sm" src="/images/icons/search-glass-704bd4ff.png"/><div class="search-box"><img src="/images/icons/search-glass-704bd4ff.png"/><input type="text" id="st-search-input" class="st-search-input" placeholder="Search Doc..."/></div><img class="swiftype-row-hider hidden-md hidden-lg" src="/images/icons/drawer-toggle-active-fcbef12a.png"/></form></div></div><div class="mobile-left-menu-toggler hidden-md hidden-lg"></div></div></div></div><div id="p
 age" class="container-fluid"><div class="row"><div id="left-menu-wrapper" class="col-md-3"><nav id="nav-main"><ul><li class="level-1"><a class="expandible" href="/"><span>Apache PredictionIO® Documentation</span></a><ul><li class="level-2"><a class="final" href="/"><span>Welcome to Apache PredictionIO®</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Started</span></a><ul><li class="level-2"><a class="final" href="/start/"><span>A Quick Intro</span></a></li><li class="level-2"><a class="final" href="/install/"><span>Installing Apache PredictionIO</span></a></li><li class="level-2"><a class="final" href="/start/download/"><span>Downloading an Engine Template</span></a></li><li class="level-2"><a class="final" href="/start/deploy/"><span>Deploying Your First Engine</span></a></li><li class="level-2"><a class="final" href="/start/customize/"><span>Customizing the Engine</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#
 "><span>Integrating with Your App</span></a><ul><li class="level-2"><a class="final" href="/appintegration/"><span>App Integration Overview</span></a></li><li class="level-2"><a class="expandible" href="/sdk/"><span>List of SDKs</span></a><ul><li class="level-3"><a class="final" href="/sdk/java/"><span>Java & Android SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/php/"><span>PHP SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/python/"><span>Python SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/ruby/"><span>Ruby SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/community/"><span>Community Powered SDKs</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Deploying an Engine</span></a><ul><li class="level-2"><a class="final" href="/deploy/"><span>Deploying as a Web Service</span></a></li><li class="level-2"><a class="final" href="/batchpredict/"><span>Batch Predictions</sp
 an></a></li><li class="level-2"><a class="final" href="/deploy/monitoring/"><span>Monitoring Engine</span></a></li><li class="level-2"><a class="final" href="/deploy/engineparams/"><span>Setting Engine Parameters</span></a></li><li class="level-2"><a class="final" href="/deploy/enginevariants/"><span>Deploying Multiple Engine Variants</span></a></li><li class="level-2"><a class="final" href="/deploy/plugin/"><span>Engine Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Customizing an Engine</span></a><ul><li class="level-2"><a class="final" href="/customize/"><span>Learning DASE</span></a></li><li class="level-2"><a class="final" href="/customize/dase/"><span>Implement DASE</span></a></li><li class="level-2"><a class="final" href="/customize/troubleshooting/"><span>Troubleshooting Engine Development</span></a></li><li class="level-2"><a class="final" href="/api/current/#package"><span>Engine Scala APIs</span></a></li></ul></li><li class
 ="level-1"><a class="expandible" href="#"><span>Collecting and Analyzing Data</span></a><ul><li class="level-2"><a class="final" href="/datacollection/"><span>Event Server Overview</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventapi/"><span>Collecting Data with REST/SDKs</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventmodel/"><span>Events Modeling</span></a></li><li class="level-2"><a class="final" href="/datacollection/webhooks/"><span>Unifying Multichannel Data with Webhooks</span></a></li><li class="level-2"><a class="final" href="/datacollection/channel/"><span>Channel</span></a></li><li class="level-2"><a class="final" href="/datacollection/batchimport/"><span>Importing Data in Batch</span></a></li><li class="level-2"><a class="final" href="/datacollection/analytics/"><span>Using Analytics Tools</span></a></li><li class="level-2"><a class="final" href="/datacollection/plugin/"><span>Event Server Plugin</span></a></li
 ></ul></li><li class="level-1"><a class="expandible" href="#"><span>Choosing an Algorithm(s)</span></a><ul><li class="level-2"><a class="final" href="/algorithm/"><span>Built-in Algorithm Libraries</span></a></li><li class="level-2"><a class="final" href="/algorithm/switch/"><span>Switching to Another Algorithm</span></a></li><li class="level-2"><a class="final" href="/algorithm/multiple/"><span>Combining Multiple Algorithms</span></a></li><li class="level-2"><a class="final" href="/algorithm/custom/"><span>Adding Your Own Algorithms</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>ML Tuning and Evaluation</span></a><ul><li class="level-2"><a class="final" href="/evaluation/"><span>Overview</span></a></li><li class="level-2"><a class="final" href="/evaluation/paramtuning/"><span>Hyperparameter Tuning</span></a></li><li class="level-2"><a class="final" href="/evaluation/evaluationdashboard/"><span>Evaluation Dashboard</span></a></li><li class="level-2
 "><a class="final" href="/evaluation/metricchoose/"><span>Choosing Evaluation Metrics</span></a></li><li class="level-2"><a class="final" href="/evaluation/metricbuild/"><span>Building Evaluation Metrics</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>System Architecture</span></a><ul><li class="level-2"><a class="final" href="/system/"><span>Architecture Overview</span></a></li><li class="level-2"><a class="final" href="/system/anotherdatastore/"><span>Using Another Data Store</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>PredictionIO® Official Templates</span></a><ul><li class="level-2"><a class="final" href="/templates/"><span>Intro</span></a></li><li class="level-2"><a class="expandible" href="#"><span>Recommendation</span></a><ul><li class="level-3"><a class="final active" href="/templates/recommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/recom
 mendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/evaluation/"><span>Evaluation Explained</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/reading-custom-events/"><span>Read Custom Events</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-data-prep/"><span>Customize Data Preparator</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-serving/"><span>Customize Serving</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/training-with-implicit-preference/"><span>Train with Implicit Preference</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/blacklist-items/"><span>Filter Recommended Items by Blacklist in Query</span></a></li><li class="le
 vel-3"><a class="final" href="/templates/recommendation/batch-evaluator/"><span>Batch Persistable Evaluator</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>E-Commerce Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/adjust-score/"><span>Adjust Score</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Similar Product</span></a><ul><li class="level-3"><a class="final" href="/temp
 lates/similarproduct/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/multi-events-multi-algos/"><span>Multiple Events and Multiple Algorithms</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/return-item-properties/"><span>Returns Item Properties</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/rid-user-set-event/"><span>Get Rid of Events for Users</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/recommended-user/"><span>Recommend Users</span></a></li></ul></li><li class="level
 -2"><a class="expandible" href="#"><span>Classification</span></a><ul><li class="level-3"><a class="final" href="/templates/classification/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/classification/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/classification/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/classification/add-algorithm/"><span>Use Alternative Algorithm</span></a></li><li class="level-3"><a class="final" href="/templates/classification/reading-custom-properties/"><span>Read Custom Properties</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Engine Template Gallery</span></a><ul><li class="level-2"><a class="final" href="/gallery/template-gallery/"><span>Browse</span></a></li><li class="level-2"><a class="final" href="/community/submit-template/"><span>Submit your Engine as a Template</span>
 </a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Demo Tutorials</span></a><ul><li class="level-2"><a class="final" href="/demo/tapster/"><span>Comics Recommendation Demo</span></a></li><li class="level-2"><a class="final" href="/demo/community/"><span>Community Contributed Demo</span></a></li><li class="level-2"><a class="final" href="/demo/textclassification/"><span>Text Classification Engine Tutorial</span></a></li></ul></li><li class="level-1"><a class="expandible" href="/community/"><span>Getting Involved</span></a><ul><li class="level-2"><a class="final" href="/community/contribute-code/"><span>Contribute Code</span></a></li><li class="level-2"><a class="final" href="/community/contribute-documentation/"><span>Contribute Documentation</span></a></li><li class="level-2"><a class="final" href="/community/contribute-sdk/"><span>Contribute a SDK</span></a></li><li class="level-2"><a class="final" href="/community/contribute-webhook/"><span>Contribute a We
 bhook</span></a></li><li class="level-2"><a class="final" href="/community/projects/"><span>Community Projects</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Help</span></a><ul><li class="level-2"><a class="final" href="/resources/faq/"><span>FAQs</span></a></li><li class="level-2"><a class="final" href="/support/"><span>Support</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Resources</span></a><ul><li class="level-2"><a class="final" href="/cli/"><span>Command-line Interface</span></a></li><li class="level-2"><a class="final" href="/resources/release/"><span>Release Cadence</span></a></li><li class="level-2"><a class="final" href="/resources/intellij/"><span>Developing Engines with IntelliJ IDEA</span></a></li><li class="level-2"><a class="final" href="/resources/upgrade/"><span>Upgrade Instructions</span></a></li><li class="level-2"><a class="final" href="/resources/glossary/"><span>Glossary</span></a></
 li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Apache Software Foundation</span></a><ul><li class="level-2"><a class="final" href="https://www.apache.org/"><span>Apache Homepage</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/licenses/"><span>License</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/sponsorship.html"><span>Sponsorship</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/thanks.html"><span>Thanks</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/security/"><span>Security</span></a></li></ul></li></ul></nav></div><div class="col-md-9 col-sm-12"><div class="content-header hidden-md hidden-lg"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">PredictionIO® Official Templates</a><span class="spacer">&gt;</span></li><li><a href="#">Recommendation</a><span class="spacer">&gt;</span></li>
 <li><span class="last">Quick Start</span></li></ul></div><div id="page-title"><h1>Quick Start - Recommendation Engine Template</h1></div></div><div id="table-of-content-wrapper"><h5>On this page</h5><aside id="table-of-contents"><ul> <li> <a href="#overview">Overview</a> </li> <li> <a href="#usage">Usage</a> </li> <li> <a href="#1-install-and-run-predictionio">1. Install and Run PredictionIO</a> </li> <li> <a href="#2-create-a-new-engine-from-an-engine-template">2. Create a new Engine from an Engine Template</a> </li> <li> <a href="#3-generate-an-app-id-and-access-key">3. Generate an App ID and Access Key</a> </li> <li> <a href="#4-collecting-data">4. Collecting Data</a> </li> <li> <a href="#5-deploy-the-engine-as-a-service">5. Deploy the Engine as a Service</a> </li> <li> <a href="#6-use-the-engine">6. Use the Engine</a> </li> </ul> </aside><hr/><a id="edit-page-link" href="https://github.com/apache/predictionio/tree/livedoc/docs/manual/source/templates/recommendation/quickstart.ht
 ml.md.erb"><img src="/images/icons/edit-pencil-d6c1bb3d.png"/>Edit this page</a></div><div class="content-header hidden-sm hidden-xs"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">PredictionIO® Official Templates</a><span class="spacer">&gt;</span></li><li><a href="#">Recommendation</a><span class="spacer">&gt;</span></li><li><span class="last">Quick Start</span></li></ul></div><div id="page-title"><h1>Quick Start - Recommendation Engine Template</h1></div></div><div class="content"> <h2 id='overview' class='header-anchors'>Overview</h2><p>This Recommendation Engine Template has integrated <strong>Apache Spark MLlib</strong>&#39;s Collaborative Filtering algorithm by default. You can customize it easily to fit your specific needs.</p><p>We are going to show you how to create your own recommendation engine for production use based on this template.</p><h2 id='usage' class='header-anchors'>Usage</h2><h3 id='event-data-requirements' class='header-anchors'>Event
  Data Requirements</h3><p>By default, the template requires the following events to be collected:</p> <ul> <li>user &#39;rate&#39; item events</li> <li>user &#39;buy&#39; item events</li> </ul> <div class="alert-message note"><p>You can customize to use other event.</p></div><h3 id='input-query' class='header-anchors'>Input Query</h3> <ul> <li>user ID</li> <li>num of recomended items</li> </ul> <h3 id='output-predictedresult' class='header-anchors'>Output PredictedResult</h3> <ul> <li>a ranked list of recommended itemIDs</li> </ul> <h2 id='1.-install-and-run-predictionio' class='header-anchors'>1. Install and Run PredictionIO</h2> <p>First you need to <a href="/install">install PredictionIO 0.12.1</a> (if you haven&#39;t done it).</p><p>Let&#39;s say you have installed PredictionIO at <code>/home/yourname/PredictionIO/</code>. For convenience, add PredictionIO&#39;s binary command path to your <code>PATH</code>, i.e. <code>/home/yourname/PredictionIO/bin</code>:</p><div class="highl
 ight 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><span class="nv">PATH</span><span class="o">=</span><span class="nv">$PATH</span>:/home/yourname/PredictionIO/bin; <span class="nb">export </span>PATH
+<!DOCTYPE html><html><head><title>Quick Start - Recommendation Engine Template</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Quick Start - Recommendation Engine Template"/><link rel="canonical" href="https://predictionio.apache.org/templates/recommendation/quickstart/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv
 .min.js"></script><script src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="search-bar-row-wrapper"><div class="container-fluid" id="search-bar-row"><div class=
 "row"><div class="col-md-9 col-sm-11 col-xs-11"><div class="hidden-md hidden-lg" id="mobile-page-heading-wrapper"><p>PredictionIO Docs</p><h4>Quick Start - Recommendation Engine Template</h4></div><h4 class="hidden-sm hidden-xs">PredictionIO Docs</h4></div><div class="col-md-3 col-sm-1 col-xs-1 hidden-md hidden-lg"><img id="left-menu-indicator" src="/images/icons/down-arrow-dfe9f7fe.png"/></div><div class="col-md-3 col-sm-12 col-xs-12 swiftype-wrapper"><div class="swiftype"><form class="search-form"><img class="search-box-toggler hidden-xs hidden-sm" src="/images/icons/search-glass-704bd4ff.png"/><div class="search-box"><img src="/images/icons/search-glass-704bd4ff.png"/><input type="text" id="st-search-input" class="st-search-input" placeholder="Search Doc..."/></div><img class="swiftype-row-hider hidden-md hidden-lg" src="/images/icons/drawer-toggle-active-fcbef12a.png"/></form></div></div><div class="mobile-left-menu-toggler hidden-md hidden-lg"></div></div></div></div><div id="p
 age" class="container-fluid"><div class="row"><div id="left-menu-wrapper" class="col-md-3"><nav id="nav-main"><ul><li class="level-1"><a class="expandible" href="/"><span>Apache PredictionIO® Documentation</span></a><ul><li class="level-2"><a class="final" href="/"><span>Welcome to Apache PredictionIO®</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Started</span></a><ul><li class="level-2"><a class="final" href="/start/"><span>A Quick Intro</span></a></li><li class="level-2"><a class="final" href="/install/"><span>Installing Apache PredictionIO</span></a></li><li class="level-2"><a class="final" href="/start/download/"><span>Downloading an Engine Template</span></a></li><li class="level-2"><a class="final" href="/start/deploy/"><span>Deploying Your First Engine</span></a></li><li class="level-2"><a class="final" href="/start/customize/"><span>Customizing the Engine</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#
 "><span>Integrating with Your App</span></a><ul><li class="level-2"><a class="final" href="/appintegration/"><span>App Integration Overview</span></a></li><li class="level-2"><a class="expandible" href="/sdk/"><span>List of SDKs</span></a><ul><li class="level-3"><a class="final" href="/sdk/java/"><span>Java & Android SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/php/"><span>PHP SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/python/"><span>Python SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/ruby/"><span>Ruby SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/community/"><span>Community Powered SDKs</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Deploying an Engine</span></a><ul><li class="level-2"><a class="final" href="/deploy/"><span>Deploying as a Web Service</span></a></li><li class="level-2"><a class="final" href="/batchpredict/"><span>Batch Predictions</sp
 an></a></li><li class="level-2"><a class="final" href="/deploy/monitoring/"><span>Monitoring Engine</span></a></li><li class="level-2"><a class="final" href="/deploy/engineparams/"><span>Setting Engine Parameters</span></a></li><li class="level-2"><a class="final" href="/deploy/enginevariants/"><span>Deploying Multiple Engine Variants</span></a></li><li class="level-2"><a class="final" href="/deploy/plugin/"><span>Engine Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Customizing an Engine</span></a><ul><li class="level-2"><a class="final" href="/customize/"><span>Learning DASE</span></a></li><li class="level-2"><a class="final" href="/customize/dase/"><span>Implement DASE</span></a></li><li class="level-2"><a class="final" href="/customize/troubleshooting/"><span>Troubleshooting Engine Development</span></a></li><li class="level-2"><a class="final" href="/api/current/#package"><span>Engine Scala APIs</span></a></li></ul></li><li class
 ="level-1"><a class="expandible" href="#"><span>Collecting and Analyzing Data</span></a><ul><li class="level-2"><a class="final" href="/datacollection/"><span>Event Server Overview</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventapi/"><span>Collecting Data with REST/SDKs</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventmodel/"><span>Events Modeling</span></a></li><li class="level-2"><a class="final" href="/datacollection/webhooks/"><span>Unifying Multichannel Data with Webhooks</span></a></li><li class="level-2"><a class="final" href="/datacollection/channel/"><span>Channel</span></a></li><li class="level-2"><a class="final" href="/datacollection/batchimport/"><span>Importing Data in Batch</span></a></li><li class="level-2"><a class="final" href="/datacollection/analytics/"><span>Using Analytics Tools</span></a></li><li class="level-2"><a class="final" href="/datacollection/plugin/"><span>Event Server Plugin</span></a></li
 ></ul></li><li class="level-1"><a class="expandible" href="#"><span>Choosing an Algorithm(s)</span></a><ul><li class="level-2"><a class="final" href="/algorithm/"><span>Built-in Algorithm Libraries</span></a></li><li class="level-2"><a class="final" href="/algorithm/switch/"><span>Switching to Another Algorithm</span></a></li><li class="level-2"><a class="final" href="/algorithm/multiple/"><span>Combining Multiple Algorithms</span></a></li><li class="level-2"><a class="final" href="/algorithm/custom/"><span>Adding Your Own Algorithms</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>ML Tuning and Evaluation</span></a><ul><li class="level-2"><a class="final" href="/evaluation/"><span>Overview</span></a></li><li class="level-2"><a class="final" href="/evaluation/paramtuning/"><span>Hyperparameter Tuning</span></a></li><li class="level-2"><a class="final" href="/evaluation/evaluationdashboard/"><span>Evaluation Dashboard</span></a></li><li class="level-2
 "><a class="final" href="/evaluation/metricchoose/"><span>Choosing Evaluation Metrics</span></a></li><li class="level-2"><a class="final" href="/evaluation/metricbuild/"><span>Building Evaluation Metrics</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>System Architecture</span></a><ul><li class="level-2"><a class="final" href="/system/"><span>Architecture Overview</span></a></li><li class="level-2"><a class="final" href="/system/anotherdatastore/"><span>Using Another Data Store</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>PredictionIO® Official Templates</span></a><ul><li class="level-2"><a class="final" href="/templates/"><span>Intro</span></a></li><li class="level-2"><a class="expandible" href="#"><span>Recommendation</span></a><ul><li class="level-3"><a class="final active" href="/templates/recommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/recom
 mendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/evaluation/"><span>Evaluation Explained</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/reading-custom-events/"><span>Read Custom Events</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-data-prep/"><span>Customize Data Preparator</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-serving/"><span>Customize Serving</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/training-with-implicit-preference/"><span>Train with Implicit Preference</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/blacklist-items/"><span>Filter Recommended Items by Blacklist in Query</span></a></li><li class="le
 vel-3"><a class="final" href="/templates/recommendation/batch-evaluator/"><span>Batch Persistable Evaluator</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>E-Commerce Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/adjust-score/"><span>Adjust Score</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Similar Product</span></a><ul><li class="level-3"><a class="final" href="/temp
 lates/similarproduct/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/multi-events-multi-algos/"><span>Multiple Events and Multiple Algorithms</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/return-item-properties/"><span>Returns Item Properties</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/rid-user-set-event/"><span>Get Rid of Events for Users</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/recommended-user/"><span>Recommend Users</span></a></li></ul></li><li class="level
 -2"><a class="expandible" href="#"><span>Classification</span></a><ul><li class="level-3"><a class="final" href="/templates/classification/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/classification/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/classification/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/classification/add-algorithm/"><span>Use Alternative Algorithm</span></a></li><li class="level-3"><a class="final" href="/templates/classification/reading-custom-properties/"><span>Read Custom Properties</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Engine Template Gallery</span></a><ul><li class="level-2"><a class="final" href="/gallery/template-gallery/"><span>Browse</span></a></li><li class="level-2"><a class="final" href="/community/submit-template/"><span>Submit your Engine as a Template</span>
 </a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Demo Tutorials</span></a><ul><li class="level-2"><a class="final" href="/demo/tapster/"><span>Comics Recommendation Demo</span></a></li><li class="level-2"><a class="final" href="/demo/community/"><span>Community Contributed Demo</span></a></li><li class="level-2"><a class="final" href="/demo/textclassification/"><span>Text Classification Engine Tutorial</span></a></li></ul></li><li class="level-1"><a class="expandible" href="/community/"><span>Getting Involved</span></a><ul><li class="level-2"><a class="final" href="/community/contribute-code/"><span>Contribute Code</span></a></li><li class="level-2"><a class="final" href="/community/contribute-documentation/"><span>Contribute Documentation</span></a></li><li class="level-2"><a class="final" href="/community/contribute-sdk/"><span>Contribute a SDK</span></a></li><li class="level-2"><a class="final" href="/community/contribute-webhook/"><span>Contribute a We
 bhook</span></a></li><li class="level-2"><a class="final" href="/community/projects/"><span>Community Projects</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Help</span></a><ul><li class="level-2"><a class="final" href="/resources/faq/"><span>FAQs</span></a></li><li class="level-2"><a class="final" href="/support/"><span>Support</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Resources</span></a><ul><li class="level-2"><a class="final" href="/cli/"><span>Command-line Interface</span></a></li><li class="level-2"><a class="final" href="/resources/release/"><span>Release Cadence</span></a></li><li class="level-2"><a class="final" href="/resources/intellij/"><span>Developing Engines with IntelliJ IDEA</span></a></li><li class="level-2"><a class="final" href="/resources/upgrade/"><span>Upgrade Instructions</span></a></li><li class="level-2"><a class="final" href="/resources/glossary/"><span>Glossary</span></a></
 li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Apache Software Foundation</span></a><ul><li class="level-2"><a class="final" href="https://www.apache.org/"><span>Apache Homepage</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/licenses/"><span>License</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/sponsorship.html"><span>Sponsorship</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/thanks.html"><span>Thanks</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/security/"><span>Security</span></a></li></ul></li></ul></nav></div><div class="col-md-9 col-sm-12"><div class="content-header hidden-md hidden-lg"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">PredictionIO® Official Templates</a><span class="spacer">&gt;</span></li><li><a href="#">Recommendation</a><span class="spacer">&gt;</span></li>
 <li><span class="last">Quick Start</span></li></ul></div><div id="page-title"><h1>Quick Start - Recommendation Engine Template</h1></div></div><div id="table-of-content-wrapper"><h5>On this page</h5><aside id="table-of-contents"><ul> <li> <a href="#overview">Overview</a> </li> <li> <a href="#usage">Usage</a> </li> <li> <a href="#1-install-and-run-predictionio">1. Install and Run PredictionIO</a> </li> <li> <a href="#2-create-a-new-engine-from-an-engine-template">2. Create a new Engine from an Engine Template</a> </li> <li> <a href="#3-generate-an-app-id-and-access-key">3. Generate an App ID and Access Key</a> </li> <li> <a href="#4-collecting-data">4. Collecting Data</a> </li> <li> <a href="#5-deploy-the-engine-as-a-service">5. Deploy the Engine as a Service</a> </li> <li> <a href="#6-use-the-engine">6. Use the Engine</a> </li> </ul> </aside><hr/><a id="edit-page-link" href="https://github.com/apache/predictionio/tree/livedoc/docs/manual/source/templates/recommendation/quickstart.ht
 ml.md.erb"><img src="/images/icons/edit-pencil-d6c1bb3d.png"/>Edit this page</a></div><div class="content-header hidden-sm hidden-xs"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">PredictionIO® Official Templates</a><span class="spacer">&gt;</span></li><li><a href="#">Recommendation</a><span class="spacer">&gt;</span></li><li><span class="last">Quick Start</span></li></ul></div><div id="page-title"><h1>Quick Start - Recommendation Engine Template</h1></div></div><div class="content"> <h2 id='overview' class='header-anchors'>Overview</h2><p>This Recommendation Engine Template has integrated <strong>Apache Spark MLlib</strong>&#39;s Collaborative Filtering algorithm by default. You can customize it easily to fit your specific needs.</p><p>We are going to show you how to create your own recommendation engine for production use based on this template.</p><h2 id='usage' class='header-anchors'>Usage</h2><h3 id='event-data-requirements' class='header-anchors'>Event
  Data Requirements</h3><p>By default, the template requires the following events to be collected:</p> <ul> <li>user &#39;rate&#39; item events</li> <li>user &#39;buy&#39; item events</li> </ul> <div class="alert-message note"><p>You can customize to use other event.</p></div><h3 id='input-query' class='header-anchors'>Input Query</h3> <ul> <li>user ID</li> <li>num of recommended items</li> </ul> <h3 id='output-predictedresult' class='header-anchors'>Output PredictedResult</h3> <ul> <li>a ranked list of recommended itemIDs</li> </ul> <h2 id='1.-install-and-run-predictionio' class='header-anchors'>1. Install and Run PredictionIO</h2> <p>First you need to <a href="/install">install PredictionIO 0.12.1</a> (if you haven&#39;t done it).</p><p>Let&#39;s say you have installed PredictionIO at <code>/home/yourname/PredictionIO/</code>. For convenience, add PredictionIO&#39;s binary command path to your <code>PATH</code>, i.e. <code>/home/yourname/PredictionIO/bin</code>:</p><div class="high
 light 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><span class="nv">PATH</span><span class="o">=</span><span class="nv">$PATH</span>:/home/yourname/PredictionIO/bin; <span class="nb">export </span>PATH
 </pre></td></tr></tbody></table> </div> <div class="alert-message note"><p>If you launched <strong>PredictionIO AWS instance</strong>, the path is located at <code>/opt/PredictionIO/bin</code>.</p></div><p>Once you have completed the installation process, please make sure all the components (PredictionIO Event Server, Elasticsearch, and HBase) are up and running.</p><div class="alert-message note"><p>If you launched <strong>PredictionIO AWS instance</strong>, you can skip <code>pio-start-all</code>. All components should have been started automatically.</p></div><p>If you are using PostgreSQL or MySQL, run the following to start PredictionIO Event Server:</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 eventserver &amp;
 </pre></td></tr></tbody></table> </div> <p>If instead you are running HBase and Elasticsearch, run the following to start all PredictionIO Event Server, HBase, and Elasticsearch:</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-start-all
 </pre></td></tr></tbody></table> </div> <p>You can check the status by running:</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 status
@@ -32,7 +32,7 @@ Your system is all ready to go.
 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span>               MyApp1 |    1 | 3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F | <span class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span>               MyApp2 |    2 | io5lz6Eg4m3Xe4JZTBFE13GMAf1dhFl6ZteuJfrO84XpdOz9wRCrDU44EUaYuXq5 | <span class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span> Finished listing 2 app<span class="o">(</span>s<span class="o">)</span>.
-</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, let&#39;s collect some training data. By default, the Recommendation Engine Template supports 2 types of events: <strong>rate</strong> and <strong>buy</strong>. A user can give a rating score to an item or buy an item. This template requires user-view-item and user-buy-item events.</p><div class="alert-message info"><p>This template can easily be customized to consider more user events such as <em>like</em>, <em>dislike</em> etc.</p></div> <p>You can send these events to PredictionIO Event Server in real-time easily by making a HTTP request or through the provided SDK. Please see <a href="/appintegration/">App Integration Overview</a> for more details how to integrate your app with SDK.</p><p>Let&#39;s try sending events to EventServer with the following <code>curl</code> commands (The corresponding SDK code is showed in other tabs).</p><
 p>Replace <code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in above steps. Note that <code>localhost:7070</code> is the default URL of the Event Server.</p><p>For convenience, set your access key to the shell variable, run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a href="#"></a></p> <h3 id='example-<strong>rate</strong>-event' class='header-anchors' >Example <strong>rate</strong> event</h3><p>A user (ID &quot;u0&quot;) gives an item (ID &quot;i0&quot;) a rating of 5 at <code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if eventTime is not specified)</p><p>Run the following <code>curl</code> command to send the <code>rate</code> event:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-b42bfa95-243d-4684-9a7c-15aa588128f4">REST API</a></li> <li data-lang="python"><a href="#tab-234d8f67-beda-4916-a918-0f901d2c4c90">Python SDK</a></li> <li data-lang="php"><a href="#tab-4ba04d0f-30c4-4ecc-bf67-caa09f00ade1">PHP
  SDK</a></li> <li data-lang="ruby"><a href="#tab-9a756f35-9f5e-419e-af99-a26cfec93994">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-2769cdc9-7429-4e14-adca-b989c9997644">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-b42bfa95-243d-4684-9a7c-15aa588128f4"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, let&#39;s collect some training data. By default, the Recommendation Engine Template supports 2 types of events: <strong>rate</strong> and <strong>buy</strong>. A user can give a rating score to an item or buy an item. This template requires user-view-item and user-buy-item events.</p><div class="alert-message info"><p>This template can easily be customized to consider more user events such as <em>like</em>, <em>dislike</em> etc.</p></div> <p>You can send these events to PredictionIO Event Server in real-time easily by making a HTTP request or through the provided SDK. Please see <a href="/appintegration/">App Integration Overview</a> for more details how to integrate your app with SDK.</p><p>Let&#39;s try sending events to EventServer with the following <code>curl</code> commands (The corresponding SDK code is showed in other tabs).</p><
 p>Replace <code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in above steps. Note that <code>localhost:7070</code> is the default URL of the Event Server.</p><p>For convenience, set your access key to the shell variable, run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a href="#"></a></p> <h3 id='example-<strong>rate</strong>-event' class='header-anchors' >Example <strong>rate</strong> event</h3><p>A user (ID &quot;u0&quot;) gives an item (ID &quot;i0&quot;) a rating of 5 at <code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if eventTime is not specified)</p><p>Run the following <code>curl</code> command to send the <code>rate</code> event:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-09c83c09-105b-4eb8-87f3-6828d789d9fe">REST API</a></li> <li data-lang="python"><a href="#tab-d2b38268-69da-445f-8eed-4afd10df5e73">Python SDK</a></li> <li data-lang="php"><a href="#tab-3f2d3dd0-d17d-4c35-8795-c446a0c1d13e">PHP
  SDK</a></li> <li data-lang="ruby"><a href="#tab-818ebe8e-1b5a-4b82-a716-0bbbaf5640bd">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-9987787a-1916-4562-a7b3-02d16493c007">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-09c83c09-105b-4eb8-87f3-6828d789d9fe"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -57,7 +57,7 @@ Your system is all ready to go.
   }
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-234d8f67-beda-4916-a918-0f901d2c4c90"> <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-d2b38268-69da-445f-8eed-4afd10df5e73"> <div class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -92,7 +92,7 @@ Your system is all ready to go.
     <span class="n">target_entity_id</span><span class="o">=&lt;</span><span class="n">ITEM</span> <span class="n">ID</span><span class="o">&gt;</span><span class="p">,</span>
     <span class="n">properties</span><span class="o">=</span> <span class="p">{</span> <span class="s">"rating"</span> <span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="o">&lt;</span><span class="n">RATING</span><span class="o">&gt;</span><span class="p">)</span> <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-4ba04d0f-30c4-4ecc-bf67-caa09f00ade1"> <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-3f2d3dd0-d17d-4c35-8795-c446a0c1d13e"> <div class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -123,7 +123,7 @@ Your system is all ready to go.
    <span class="s1">'properties'</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span><span class="s1">'rating'</span><span class="o">=&gt;</span> <span class="o">&lt;</span><span class="nx">RATING</span><span class="o">&gt;</span><span class="p">)</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-9a756f35-9f5e-419e-af99-a26cfec93994"> <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-818ebe8e-1b5a-4b82-a716-0bbbaf5640bd"> <div class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -150,7 +150,7 @@ Your system is all ready to go.
   <span class="p">}</span>
 <span class="p">)</span>
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-2769cdc9-7429-4e14-adca-b989c9997644"> <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-9987787a-1916-4562-a7b3-02d16493c007"> <div class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -179,7 +179,7 @@ Your system is all ready to go.
     <span class="o">.</span><span class="na">property</span><span class="o">(</span><span class="s">"rating"</span><span class="o">,</span> <span class="k">new</span> <span class="n">Float</span><span class="o">(&lt;</span><span class="n">RATING</span><span class="o">&gt;));</span>
 <span class="n">client</span><span class="o">.</span><span class="na">createEvent</span><span class="o">(</span><span class="n">rateEvent</span><span class="o">);</span>
 
-</pre></td> </tr></tbody></table> </div> </div> </div> <h3 id='example-<strong>buy</strong>-event' class='header-anchors' >Example <strong>buy</strong> event</h3><p>A user (ID &quot;u1&quot;) buys an item (ID &quot;i2&quot;) at <code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if eventTime is not specified)</p><p>Run the following <code>curl</code> command to send the <code>buy</code> event:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-1e7bc755-98fe-4aa9-86ba-b9663b9d67f7">REST API</a></li> <li data-lang="python"><a href="#tab-6ca77cbe-b6ae-4caa-af07-7ae6b52b77aa">Python SDK</a></li> <li data-lang="php"><a href="#tab-b9d95420-28de-46e2-829a-5feace0ad5b2">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-1666a036-9304-4b50-840e-211a394d2128">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-953cc8a6-5040-497c-b871-493f594a48f4">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-1e7bc755-98fe-4aa9-86ba-b9
 663b9d67f7"> <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> <h3 id='example-<strong>buy</strong>-event' class='header-anchors' >Example <strong>buy</strong> event</h3><p>A user (ID &quot;u1&quot;) buys an item (ID &quot;i2&quot;) at <code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if eventTime is not specified)</p><p>Run the following <code>curl</code> command to send the <code>buy</code> event:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-a96eaf3e-a6f2-40f5-b5cb-ec8db8fb3f30">REST API</a></li> <li data-lang="python"><a href="#tab-28a95088-d88c-40d8-964e-cbcab3cb3c63">Python SDK</a></li> <li data-lang="php"><a href="#tab-b949a83e-c3e4-4c37-96bf-15827f8ec407">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-23918a32-85a5-48c3-a8ce-73268a142bca">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-7258aad2-0051-4fbd-8730-b0b309d0897a">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-a96eaf3e-a6f2-40f5-b5cb-ec
 8db8fb3f30"> <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
@@ -198,7 +198,7 @@ Your system is all ready to go.
   "targetEntityId" : "i2",
   "eventTime" : "2014-11-10T12:34:56.123-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-6ca77cbe-b6ae-4caa-af07-7ae6b52b77aa"> <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-28a95088-d88c-40d8-964e-cbcab3cb3c63"> <div class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -213,7 +213,7 @@ Your system is all ready to go.
     <span class="n">target_entity_type</span><span class="o">=</span><span class="s">"item"</span><span class="p">,</span>
     <span class="n">target_entity_id</span><span class="o">=&lt;</span><span class="n">ITEM</span> <span class="n">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-b9d95420-28de-46e2-829a-5feace0ad5b2"> <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-b949a83e-c3e4-4c37-96bf-15827f8ec407"> <div class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -232,7 +232,7 @@ Your system is all ready to go.
    <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> <span class="o">&lt;</span><span class="nx">ITEM</span> <span class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-1666a036-9304-4b50-840e-211a394d2128"> <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-23918a32-85a5-48c3-a8ce-73268a142bca"> <div class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -249,7 +249,7 @@ Your system is all ready to go.
     <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> <span class="o">&lt;</span><span class="no">ITEM</span> <span class="no">ID</span><span class="o">&gt;</span>
   <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-953cc8a6-5040-497c-b871-493f594a48f4"> <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-7258aad2-0051-4fbd-8730-b0b309d0897a"> <div class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -297,17 +297,17 @@ Your system is all ready to go.
 </pre></td></tr></tbody></table> </div> <p>When the engine is deployed successfully and running, you should see a console message similar to the following:</p><div class="highlight shell"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2</pre></td><td class="code"><pre><span class="o">[</span>INFO] <span class="o">[</span>HttpListener] Bound to /0.0.0.0:8000
 <span class="o">[</span>INFO] <span class="o">[</span>MasterActor] Bind successful. Ready to serve.
-</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine process.</p><p>By default, the deployed engine binds to <a href="http://localhost:8000"><a href="http://localhost:8000">http://localhost:8000</a></a>. You can visit that page in your web browser to check its status.</p><p><img alt="Engine Status" src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' class='header-anchors'>6. Use the Engine</h2><p>Now, You can try to retrieve predicted results. To recommend 4 movies to user whose id is 1, you send this JSON <code>{ &quot;user&quot;: &quot;1&quot;, &quot;num&quot;: 4 }</code> to the deployed engine and it will return a JSON of the recommended movies. Simply send a query by making a HTTP request or through the <code>EngineClient</code> of an SDK.</p><p>With the deployed engine running, open another 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-250c9e58-753f-4656-94dc-d2a8a1e8a229">REST API</a></li> <li data-lang="python"><a href="#tab-7afc0aaa-1605-4a5a-b608-286b95e1e0a8">Python SDK</a></li> <li data-lang="php"><a href="#tab-e187a542-3823-435c-9807-bb96db349989">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-1ef5e1ee-61fc-46b9-b1ea-52c58d8699ea">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-392b56b9-4c00-41c6-97f7-131f3bd3d929">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-250c9e58-753f-4656-94dc-d2a8a1e8a229"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine process.</p><p>By default, the deployed engine binds to <a href="http://localhost:8000"><a href="http://localhost:8000">http://localhost:8000</a></a>. You can visit that page in your web browser to check its status.</p><p><img alt="Engine Status" src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' class='header-anchors'>6. Use the Engine</h2><p>Now, You can try to retrieve predicted results. To recommend 4 movies to user whose id is 1, you send this JSON <code>{ &quot;user&quot;: &quot;1&quot;, &quot;num&quot;: 4 }</code> to the deployed engine and it will return a JSON of the recommended movies. Simply send a query by making a HTTP request or through the <code>EngineClient</code> of an SDK.</p><p>With the deployed engine running, open another 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-8e38c7b8-2185-4534-b81e-b7bdb72f8d15">REST API</a></li> <li data-lang="python"><a href="#tab-fb9a5f61-32ca-46ff-870d-53366db7642e">Python SDK</a></li> <li data-lang="php"><a href="#tab-10745a66-3359-4d70-9d90-7e65c6fbae65">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-b043c44e-e754-4561-848a-b9e3b3220e16">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-15bc5cc6-c392-4694-a98c-a0d55505ef11">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-8e38c7b8-2185-4534-b81e-b7bdb72f8d15"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3</pre></td> <td class="code"><pre><span class="gp">$ </span>curl -H <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
 -d <span class="s1">'{ "user": "1", "num": 4 }'</span> http://localhost:8000/queries.json
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-7afc0aaa-1605-4a5a-b608-286b95e1e0a8"> <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-fb9a5f61-32ca-46ff-870d-53366db7642e"> <div class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3</pre></td> <td class="code"><pre><span class="kn">import</span> <span class="nn">predictionio</span>
 <span class="n">engine_client</span> <span class="o">=</span> <span class="n">predictionio</span><span class="o">.</span><span class="n">EngineClient</span><span class="p">(</span><span class="n">url</span><span class="o">=</span><span class="s">"http://localhost:8000"</span><span class="p">)</span>
 <span class="k">print</span> <span class="n">engine_client</span><span class="o">.</span><span class="n">send_query</span><span class="p">({</span><span class="s">"user"</span><span class="p">:</span> <span class="s">"1"</span><span class="p">,</span> <span class="s">"num"</span><span class="p">:</span> <span class="mi">4</span><span class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-e187a542-3823-435c-9807-bb96db349989"> <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-10745a66-3359-4d70-9d90-7e65c6fbae65"> <div class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -326,7 +326,7 @@ Your system is all ready to go.
 <span class="nb">print_r</span><span class="p">(</span><span class="nv">$response</span><span class="p">);</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-1ef5e1ee-61fc-46b9-b1ea-52c58d8699ea"> <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-b043c44e-e754-4561-848a-b9e3b3220e16"> <div class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -339,7 +339,7 @@ Your system is all ready to go.
 <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="p">.</span><span class="nf">send_query</span><span class="p">(</span><span class="s1">'user'</span> <span class="o">=&gt;</span> <span class="o">&lt;</span><span class="no">USER</span> <span class="no">ID</span><span class="o">&gt;</span><span class="p">,</span> <span class="s1">'num'</span> <span class="o">=&gt;</span> <span class="o">&lt;</span><span class="no">NUMBER</span> <span class="p">(</span><span class="n">integer</span><span class="p">)</span><span class="o">&gt;</span><span class="p">)</span>
 
 <span class="nb">puts</span> <span class="n">response</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-392b56b9-4c00-41c6-97f7-131f3bd3d929"> <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-15bc5cc6-c392-4694-a98c-a0d55505ef11"> <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/c17b9607/templates/similarproduct/dase/index.html
----------------------------------------------------------------------
diff --git a/templates/similarproduct/dase/index.html b/templates/similarproduct/dase/index.html
index 1db651c..63d1a65 100644
--- a/templates/similarproduct/dase/index.html
+++ b/templates/similarproduct/dase/index.html
@@ -503,7 +503,7 @@
   <span class="n">numIterations</span><span class="k">:</span> <span class="kt">Int</span><span class="o">,</span>
   <span class="n">lambda</span><span class="k">:</span> <span class="kt">Double</span><span class="o">,</span>
   <span class="n">seed</span><span class="k">:</span> <span class="kt">Option</span><span class="o">[</span><span class="kt">Long</span><span class="o">])</span> <span class="k">extends</span> <span class="nc">Params</span>
-</pre></td></tr></tbody></table> </div> <p>The <code>seed</code> parameter is an optional parameter, which is used by MLlib ALS algorithm internally to generate random values. If the <code>seed</code> is not specified, current system time would be used and hence each train may produce different reuslts. Specify a fixed value for the <code>seed</code> if you want to have deterministic result (For example, when you are testing).</p><p><code>ALS.trainImplicit()</code> then returns a <code>MatrixFactorizationModel</code> model which contains two RDDs: userFeatures and productFeatures. They correspond to the user X latent features matrix and item X latent features matrix, respectively. In this case, we will make use of the productFeatures matrix to find simliar products by comparing the similarity of the latent features. Hence, we store this productFeatures as defined in <code>ALSModel</code> class:</p><div class="highlight scala"><table style="border-spacing: 0"><tbody><tr><td class="gu
 tter gl" style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p>The <code>seed</code> parameter is an optional parameter, which is used by MLlib ALS algorithm internally to generate random values. If the <code>seed</code> is not specified, current system time would be used and hence each train may produce different reuslts. Specify a fixed value for the <code>seed</code> if you want to have deterministic result (For example, when you are testing).</p><p><code>ALS.trainImplicit()</code> then returns a <code>MatrixFactorizationModel</code> model which contains two RDDs: userFeatures and productFeatures. They correspond to the user X latent features matrix and item X latent features matrix, respectively. In this case, we will make use of the productFeatures matrix to find similar products by comparing the similarity of the latent features. Hence, we store this productFeatures as defined in <code>ALSModel</code> class:</p><div class="highlight scala"><table style="border-spacing: 0"><tbody><tr><td class="gu
 tter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4


[05/11] predictionio-site git commit: Documentation based on apache/predictionio#54415e1066ae2d646eef62ebfdf801ace1de2097

Posted by gi...@apache.org.
http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/templates/javaecommercerecommendation/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/javaecommercerecommendation/quickstart/index.html b/templates/javaecommercerecommendation/quickstart/index.html
index 1df8ca8..94fc247 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-73cb74d8-9175-4de9-bc38-a0f5fa3e08d5">REST API</a></li> <li data-lang="python"><a href="#tab-fdfa2548-40e5-4425-8075-b69eb329f4d6">Python SDK</a></li> <li data-lang="php"><a href="#tab-149e7cf5-aac4-47ff-86c2-87757683181a">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-613fff9c-3fdf-461f-b59c-c75fba092b68">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-d7f622cd-f80e-405a-a6c8-7835e6c40121">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-73cb74d8-9175-4de9-bc38-a0f5fa3e08d5"> <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-0df315a8-176e-4dc8-a708-0c3ce05892a1">REST API</a></li> <li data-lang="python"><a href="#tab-8fa0d6ba-c00d-47ef-9211-e35f2adbe9e4">Python SDK</a></li> <li data-lang="php"><a href="#tab-edcbaa1e-782c-42b9-a89c-c6c9c51d9906">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-2f2d1b66-44f4-4cce-87a9-85b70f556d10">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-a0380d96-b647-40eb-8658-400171fff189">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-0df315a8-176e-4dc8-a708-0c3ce05892a1"> <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-fdfa2548-40e5-4425-8075-b69eb329f4d6"> <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-8fa0d6ba-c00d-47ef-9211-e35f2adbe9e4"> <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-149e7cf5-aac4-47ff-86c2-87757683181a"> <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-edcbaa1e-782c-42b9-a89c-c6c9c51d9906"> <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-613fff9c-3fdf-461f-b59c-c75fba092b68"> <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-2f2d1b66-44f4-4cce-87a9-85b70f556d10"> <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-d7f622cd-f80e-405a-a6c8-7835e6c40121"> <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-a0380d96-b647-40eb-8658-400171fff189"> <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-45d679d6-102f-46bc-b617-629aba9b85f9">REST API</a></li> <li data-lang="python"><a href="#tab-d9a5081f-fec1-45a3-ae93-98285c757feb">Python SDK</a></li> <li data-lang="php"><a href="#tab-da9b3263-423b-488a-b79d-be76321d5416">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-bccff134-621e-4518-9216-485d860a41c9">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-b0559711-36bd-46c3-af51-5dc1d9251275">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-45d679
 d6-102f-46bc-b617-629aba9b85f9"> <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-2211b933-582d-4f9f-a92a-4797961420b9">REST API</a></li> <li data-lang="python"><a href="#tab-24944fa0-7627-4c0d-953d-323b2b1ff3e9">Python SDK</a></li> <li data-lang="php"><a href="#tab-4c6560b9-c02b-4922-b150-fdaa1d94f24c">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-26cd44d1-1123-435a-82cb-df696cb1554a">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-a9175dc8-beb2-465c-b67c-ccf185885133">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-2211b9
 33-582d-4f9f-a92a-4797961420b9"> <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-d9a5081f-fec1-45a3-ae93-98285c757feb"> <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-24944fa0-7627-4c0d-953d-323b2b1ff3e9"> <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-da9b3263-423b-488a-b79d-be76321d5416"> <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-4c6560b9-c02b-4922-b150-fdaa1d94f24c"> <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-bccff134-621e-4518-9216-485d860a41c9"> <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-26cd44d1-1123-435a-82cb-df696cb1554a"> <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-b0559711-36bd-46c3-af51-5dc1d9251275"> <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-a9175dc8-beb2-465c-b67c-ccf185885133"> <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-06760502-f207-4f3c-9bc9-84c78039beba">REST API</a></li> <li data-lang="python"><a href="#tab-67108a9f-7579-4010-bc7a-3094f608fe03">Python SDK</a></li> <li data-lang="php"><a href="#tab-a2b6038e-d990-4886-a46a-f363f02c7075">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-4423c331-16ba-403d-8faa-fef4c3
 616bb1">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-33f55700-4497-4755-b130-27767a2d0cac">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-06760502-f207-4f3c-9bc9-84c78039beba"> <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-81c029a1-dd2e-4718-adea-8c18ab9b69be">REST API</a></li> <li data-lang="python"><a href="#tab-27c54147-11fd-46e3-88d1-5c8472f95646">Python SDK</a></li> <li data-lang="php"><a href="#tab-b2dded73-d0a8-462b-9ddc-9037394565ce">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-d79da7a6-7da0-45c9-b7c9-ea76df
 b1f6fd">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-4d7d6ee4-8c91-468e-9775-5acaa8036e78">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-81c029a1-dd2e-4718-adea-8c18ab9b69be"> <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-67108a9f-7579-4010-bc7a-3094f608fe03"> <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-27c54147-11fd-46e3-88d1-5c8472f95646"> <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-a2b6038e-d990-4886-a46a-f363f02c7075"> <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-b2dded73-d0a8-462b-9ddc-9037394565ce"> <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-4423c331-16ba-403d-8faa-fef4c3616bb1"> <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-d79da7a6-7da0-45c9-b7c9-ea76dfb1f6fd"> <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-33f55700-4497-4755-b130-27767a2d0cac"> <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-4d7d6ee4-8c91-468e-9775-5acaa8036e78"> <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-0a288ff3-319f-4875-bfe4-47b14790eb9e">REST API</a></li> <li data-lang="python"><a href="#tab-acfc770a-c23b-4f48-a9a4-54856b0bfe85">Python SDK</a></li> <li data-lang="php"><a href="#tab-cb7f2c6f-bc99-4184-ba64-352f54ec47b6">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-8e72d7cb-1310-4594-9239-6c127485dff8">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-09a743eb-ce69-4506-a22f-e3834d4c7133">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-0a288ff3-319f-4875-bfe4-47b14790eb9e"> <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-20a7a1af-f880-4aaf-923e-90a4311250d9">REST API</a></li> <li data-lang="python"><a href="#tab-f97eea6a-3de6-4dca-898d-09e7874e98c2">Python SDK</a></li> <li data-lang="php"><a href="#tab-02874185-74a3-4697-81a0-02a1829da1d5">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-1be0429b-1752-43ea-8cc5-f7b9b6c976f2">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-2eca84e0-07b6-4519-9905-f3689a858bb6">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-20a7a1af-f880-4aaf-923e-90a4311250d9"> <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-acfc770a-c23b-4f48-a9a4-54856b0bfe85"> <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-f97eea6a-3de6-4dca-898d-09e7874e98c2"> <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-cb7f2c6f-bc99-4184-ba64-352f54ec47b6"> <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-02874185-74a3-4697-81a0-02a1829da1d5"> <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-8e72d7cb-1310-4594-9239-6c127485dff8"> <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-1be0429b-1752-43ea-8cc5-f7b9b6c976f2"> <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-09a743eb-ce69-4506-a22f-e3834d4c7133"> <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-2eca84e0-07b6-4519-9905-f3689a858bb6"> <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-a067efe5-5e71-47d4-ad22-6836e378ee82">REST API</a></li> <li data-lang="python"><a href="#tab-b03f7190-49b2-4fd3-a6de-ff1260cda9d8">Python SDK</a></li> <li data-lang="php"><a href="#tab-ed95c0e6-891f-4606-9eca-d4fa59f230ab">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-65de3813-8f8d-4ed6-a6ca-a8e15b9a0512">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-47be99f7-75c0-48df-b36a-9d2bbfe11b55">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-a067efe5-5e71-47d4-ad22-6836e378ee82"> <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-7cffe299-f094-4260-abfd-510f6d5b9ad5">REST API</a></li> <li data-lang="python"><a href="#tab-b1dfd4a8-25bd-411e-96eb-2f92a901a8da">Python SDK</a></li> <li data-lang="php"><a href="#tab-4ae5415a-8007-488b-85a7-91cecd271f9d">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-0e5dfc72-50a0-443e-abf6-d0bf3c8095fe">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-6ae192b7-2ecf-4180-ae3b-9df4b48f0734">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-7cffe299-f094-4260-abfd-510f6d5b9ad5"> <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-b03f7190-49b2-4fd3-a6de-ff1260cda9d8"> <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-b1dfd4a8-25bd-411e-96eb-2f92a901a8da"> <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-ed95c0e6-891f-4606-9eca-d4fa59f230ab"> <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-4ae5415a-8007-488b-85a7-91cecd271f9d"> <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-65de3813-8f8d-4ed6-a6ca-a8e15b9a0512"> <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-0e5dfc72-50a0-443e-abf6-d0bf3c8095fe"> <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-47be99f7-75c0-48df-b36a-9d2bbfe11b55"> <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-6ae192b7-2ecf-4180-ae3b-9df4b48f0734"> <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-55833016-19c4-40b3-9504-8acbbb8328e9">REST API</a></li> <li data-lang="python"><a href="#tab-77e474b3-a9de-4f63-bb08-a9bc677e7b40">Python SDK</a></li> <li data-lang="php"><a href="#tab-3f7ec24b-af47-442e-8777-03fa172d914f">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-fc992543-d63d-471d-aee5-8ae46053379a">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-08459971-afe2-41a9-a7ea-9001e2875338">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-55833016-19c4-40b3-9504-8acbbb8328e9"> <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-b19b650d-302e-4b61-aeec-2b82bb2e799b">REST API</a></li> <li data-lang="python"><a href="#tab-381059c3-5b02-486f-8e8e-38a7c3785cb5">Python SDK</a></li> <li data-lang="php"><a href="#tab-3f472b87-86d5-484c-adae-3ac14f2b43f9">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-3cac83ad-cbc6-4da6-b7db-9ac1747a56e7">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-d8f9c17a-5a5b-41f0-a9e5-8c66ccd3af20">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-b19b650d-302e-4b61-aeec-2b82bb2e799b"> <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-77e474b3-a9de-4f63-bb08-a9bc677e7b40"> <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-381059c3-5b02-486f-8e8e-38a7c3785cb5"> <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-3f7ec24b-af47-442e-8777-03fa172d914f"> <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-3f472b87-86d5-484c-adae-3ac14f2b43f9"> <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-fc992543-d63d-471d-aee5-8ae46053379a"> <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-3cac83ad-cbc6-4da6-b7db-9ac1747a56e7"> <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-08459971-afe2-41a9-a7ea-9001e2875338"> <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-d8f9c17a-5a5b-41f0-a9e5-8c66ccd3af20"> <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/c17b9607/templates/leadscoring/dase/index.html
----------------------------------------------------------------------
diff --git a/templates/leadscoring/dase/index.html b/templates/leadscoring/dase/index.html
index fe08378..82a9b74 100644
--- a/templates/leadscoring/dase/index.html
+++ b/templates/leadscoring/dase/index.html
@@ -502,7 +502,7 @@
 <span class="o">)</span> <span class="k">extends</span> <span class="nc">Serializable</span> <span class="o">{</span>
   <span class="o">...</span>
 <span class="o">}</span>
-</pre></td></tr></tbody></table> </div> <h3 id='predict(...)' class='header-anchors'>predict(...)</h3><p><code>predict</code> is called when you send a JSON query to <a href="http://localhost:8000/queries.json">http://localhost:8000/queries.json</a>. PredictionIO converts the query, such as &#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 <code>Query</code> class you defined previously in <code>Engine.scala</code>.</p><p>The <code>predict()</code> function does the following:</p> <ol> <li>convert the Query to the required feature vector input</li> <li>use the <code>RandomForestModel</code> to predict the probabilty of conversion given this feature.</li> </ol> <div class="highlight scala"><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='predict(...)' class='header-anchors'>predict(...)</h3><p><code>predict</code> is called when you send a JSON query to <a href="http://localhost:8000/queries.json">http://localhost:8000/queries.json</a>. PredictionIO converts the query, such as &#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 <code>Query</code> class you defined previously in <code>Engine.scala</code>.</p><p>The <code>predict()</code> function does the following:</p> <ol> <li>convert the Query to the required feature vector input</li> <li>use the <code>RandomForestModel</code> to predict the probability of conversion given this feature.</li> </ol> <div class="highlight scala"><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/c17b9607/templates/leadscoring/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/leadscoring/quickstart/index.html b/templates/leadscoring/quickstart/index.html
index e5547d6..71af543 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-cbf7b816-3b4d-4a86-
 95c5-672e4e2060be">REST API</a></li> <li data-lang="python"><a href="#tab-b2929e82-ac88-46ca-9a34-3ff601ebde07">Python SDK</a></li> <li data-lang="php"><a href="#tab-18d9fe85-5a1a-4ea4-9bd3-2ef23c38720a">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-5cbcc8a3-26c5-4846-add3-a6a940aa0392">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-0e6359d3-2946-41e0-bb28-4549faa57268">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-cbf7b816-3b4d-4a86-95c5-672e4e2060be"> <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-14c582b7-b262-43e7-
 836a-00f806401caf">REST API</a></li> <li data-lang="python"><a href="#tab-8e541974-58a2-4e9f-b93f-d20dd3959016">Python SDK</a></li> <li data-lang="php"><a href="#tab-6b20f576-b6ea-45e9-aa6f-0fd027189aca">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-057a96f1-11ba-45b4-b093-9b8d923f4c64">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-25420348-2759-4ef9-8517-9f8a94a47f17">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-14c582b7-b262-43e7-836a-00f806401caf"> <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-b2929e82-ac88-46ca-9a34-3ff601ebde07"> <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-8e541974-58a2-4e9f-b93f-d20dd3959016"> <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-18d9fe85-5a1a-4ea4-9bd3-2ef23c38720a"> <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-6b20f576-b6ea-45e9-aa6f-0fd027189aca"> <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-5cbcc8a3-26c5-4846-add3-a6a940aa0392"> <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-057a96f1-11ba-45b4-b093-9b8d923f4c64"> <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-0e6359d3-2946-41e0-bb28-4549faa57268"> <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-25420348-2759-4ef9-8517-9f8a94a47f17"> <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-72a923c3-a719-4a2b-9b31-ba8f0330e0fe">REST API</a></li> <li data-lang="python"><a href="#tab-b678ed41-65ab-47e6-9a21-0025bfd35188">Python SDK</a></li> <li data-lang="php"><a href="#tab-7d407bcf-5fcd-4968-8eeb-706c0e17ce97">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-dee15d84-eeef-481f-9f9c-c3c685894bc2">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-96e529b0-f8e3-472f-af1d-9d306dfdfe08">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-72a923c3-a719-4a2b-9b31-ba8f0330e0fe"> <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-cb47abb3-b615-4373-a6a3-ef407bd4b45a">REST API</a></li> <li data-lang="python"><a href="#tab-6ddef848-3194-4f79-acb2-8d3b70f1709c">Python SDK</a></li> <li data-lang="php"><a href="#tab-4cfeccd3-4084-486d-9de9-20069e4e518a">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-751865ed-21aa-4954-bd15-93dc7c051c90">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-5c91bca4-fb9b-4bda-a278-fab34941e03c">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-cb47abb3-b615-4373-a6a3-ef407bd4b45a"> <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-b678ed41-65ab-47e6-9a21-0025bfd35188"> <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-6ddef848-3194-4f79-acb2-8d3b70f1709c"> <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-7d407bcf-5fcd-4968-8eeb-706c0e17ce97"> <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-4cfeccd3-4084-486d-9de9-20069e4e518a"> <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-dee15d84-eeef-481f-9f9c-c3c685894bc2"> <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-751865ed-21aa-4954-bd15-93dc7c051c90"> <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-96e529b0-f8e3-472f-af1d-9d306dfdfe08"> <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-5c91bca4-fb9b-4bda-a278-fab34941e03c"> <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-e2bee48b-cb6c-4cd1-88ec-7c68cba62e2f">REST API</a></li> <li data-lang="python"><a href="#tab-7413c697-17c1-4541-86f5-53bc4ce565c9">Python SDK</a></li> <li data-lang="php"><a href="#tab-072fbc02-c876-4a21-ad48-9c7464a66d52">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-75b04e26-6e57-4155-ac98-5e13fb07ebab">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-09de1d9d-1968-4b96-80c0-9bdfb9f437ef">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-e2bee48b-cb6c-4cd1-88ec-7c68cba62e2f"> <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-eba9342b-53c0-4864-b47f-202478b6e7c8">REST API</a></li> <li data-lang="python"><a href="#tab-13b07a2e-b1a6-4f5d-b1ce-cd327a2883f4">Python SDK</a></li> <li data-lang="php"><a href="#tab-2bc2e3d8-ddb5-4638-b5b1-e9475a3b98ba">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-06931954-c1a9-420e-9d20-e3619da036ba">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-7e3dec72-3c5c-4316-a41f-c30ca6d03b08">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-eba9342b-53c0-4864-b47f-202478b6e7c8"> <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-7413c697-17c1-4541-86f5-53bc4ce565c9"> <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-13b07a2e-b1a6-4f5d-b1ce-cd327a2883f4"> <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-072fbc02-c876-4a21-ad48-9c7464a66d52"> <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-2bc2e3d8-ddb5-4638-b5b1-e9475a3b98ba"> <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-75b04e26-6e57-4155-ac98-5e13fb07ebab"> <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-06931954-c1a9-420e-9d20-e3619da036ba"> <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-09de1d9d-1968-4b96-80c0-9bdfb9f437ef"> <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-7e3dec72-3c5c-4316-a41f-c30ca6d03b08"> <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


[10/11] predictionio-site git commit: Documentation based on apache/predictionio#54415e1066ae2d646eef62ebfdf801ace1de2097

Posted by gi...@apache.org.
http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/evaluation/metricchoose/index.html
----------------------------------------------------------------------
diff --git a/evaluation/metricchoose/index.html b/evaluation/metricchoose/index.html
index 69c04ba..3b8707c 100644
--- a/evaluation/metricchoose/index.html
+++ b/evaluation/metricchoose/index.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><title>Choosing Evaluation Metrics</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Choosing Evaluation Metrics"/><link rel="canonical" href="https://predictionio.apache.org/evaluation/metricchoose/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><script src="//cdn.mathjax.o
 rg/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="search-bar-row-wrapper"><div class="container-fluid" id="search-bar-row"><div class="row"><div class="col-md-9 col-sm-11 col-xs-11
 "><div class="hidden-md hidden-lg" id="mobile-page-heading-wrapper"><p>PredictionIO Docs</p><h4>Choosing Evaluation Metrics</h4></div><h4 class="hidden-sm hidden-xs">PredictionIO Docs</h4></div><div class="col-md-3 col-sm-1 col-xs-1 hidden-md hidden-lg"><img id="left-menu-indicator" src="/images/icons/down-arrow-dfe9f7fe.png"/></div><div class="col-md-3 col-sm-12 col-xs-12 swiftype-wrapper"><div class="swiftype"><form class="search-form"><img class="search-box-toggler hidden-xs hidden-sm" src="/images/icons/search-glass-704bd4ff.png"/><div class="search-box"><img src="/images/icons/search-glass-704bd4ff.png"/><input type="text" id="st-search-input" class="st-search-input" placeholder="Search Doc..."/></div><img class="swiftype-row-hider hidden-md hidden-lg" src="/images/icons/drawer-toggle-active-fcbef12a.png"/></form></div></div><div class="mobile-left-menu-toggler hidden-md hidden-lg"></div></div></div></div><div id="page" class="container-fluid"><div class="row"><div id="left-men
 u-wrapper" class="col-md-3"><nav id="nav-main"><ul><li class="level-1"><a class="expandible" href="/"><span>Apache PredictionIO® Documentation</span></a><ul><li class="level-2"><a class="final" href="/"><span>Welcome to Apache PredictionIO®</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Started</span></a><ul><li class="level-2"><a class="final" href="/start/"><span>A Quick Intro</span></a></li><li class="level-2"><a class="final" href="/install/"><span>Installing Apache PredictionIO</span></a></li><li class="level-2"><a class="final" href="/start/download/"><span>Downloading an Engine Template</span></a></li><li class="level-2"><a class="final" href="/start/deploy/"><span>Deploying Your First Engine</span></a></li><li class="level-2"><a class="final" href="/start/customize/"><span>Customizing the Engine</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Integrating with Your App</span></a><ul><li class="leve
 l-2"><a class="final" href="/appintegration/"><span>App Integration Overview</span></a></li><li class="level-2"><a class="expandible" href="/sdk/"><span>List of SDKs</span></a><ul><li class="level-3"><a class="final" href="/sdk/java/"><span>Java & Android SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/php/"><span>PHP SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/python/"><span>Python SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/ruby/"><span>Ruby SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/community/"><span>Community Powered SDKs</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Deploying an Engine</span></a><ul><li class="level-2"><a class="final" href="/deploy/"><span>Deploying as a Web Service</span></a></li><li class="level-2"><a class="final" href="/batchpredict/"><span>Batch Predictions</span></a></li><li class="level-2"><a class="final" href="/deploy/
 monitoring/"><span>Monitoring Engine</span></a></li><li class="level-2"><a class="final" href="/deploy/engineparams/"><span>Setting Engine Parameters</span></a></li><li class="level-2"><a class="final" href="/deploy/enginevariants/"><span>Deploying Multiple Engine Variants</span></a></li><li class="level-2"><a class="final" href="/deploy/plugin/"><span>Engine Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Customizing an Engine</span></a><ul><li class="level-2"><a class="final" href="/customize/"><span>Learning DASE</span></a></li><li class="level-2"><a class="final" href="/customize/dase/"><span>Implement DASE</span></a></li><li class="level-2"><a class="final" href="/customize/troubleshooting/"><span>Troubleshooting Engine Development</span></a></li><li class="level-2"><a class="final" href="/api/current/#package"><span>Engine Scala APIs</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Collecting and 
 Analyzing Data</span></a><ul><li class="level-2"><a class="final" href="/datacollection/"><span>Event Server Overview</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventapi/"><span>Collecting Data with REST/SDKs</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventmodel/"><span>Events Modeling</span></a></li><li class="level-2"><a class="final" href="/datacollection/webhooks/"><span>Unifying Multichannel Data with Webhooks</span></a></li><li class="level-2"><a class="final" href="/datacollection/channel/"><span>Channel</span></a></li><li class="level-2"><a class="final" href="/datacollection/batchimport/"><span>Importing Data in Batch</span></a></li><li class="level-2"><a class="final" href="/datacollection/analytics/"><span>Using Analytics Tools</span></a></li><li class="level-2"><a class="final" href="/datacollection/plugin/"><span>Event Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><
 span>Choosing an Algorithm(s)</span></a><ul><li class="level-2"><a class="final" href="/algorithm/"><span>Built-in Algorithm Libraries</span></a></li><li class="level-2"><a class="final" href="/algorithm/switch/"><span>Switching to Another Algorithm</span></a></li><li class="level-2"><a class="final" href="/algorithm/multiple/"><span>Combining Multiple Algorithms</span></a></li><li class="level-2"><a class="final" href="/algorithm/custom/"><span>Adding Your Own Algorithms</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>ML Tuning and Evaluation</span></a><ul><li class="level-2"><a class="final" href="/evaluation/"><span>Overview</span></a></li><li class="level-2"><a class="final" href="/evaluation/paramtuning/"><span>Hyperparameter Tuning</span></a></li><li class="level-2"><a class="final" href="/evaluation/evaluationdashboard/"><span>Evaluation Dashboard</span></a></li><li class="level-2"><a class="final active" href="/evaluation/metricchoose/"><spa
 n>Choosing Evaluation Metrics</span></a></li><li class="level-2"><a class="final" href="/evaluation/metricbuild/"><span>Building Evaluation Metrics</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>System Architecture</span></a><ul><li class="level-2"><a class="final" href="/system/"><span>Architecture Overview</span></a></li><li class="level-2"><a class="final" href="/system/anotherdatastore/"><span>Using Another Data Store</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>PredictionIO® Official Templates</span></a><ul><li class="level-2"><a class="final" href="/templates/"><span>Intro</span></a></li><li class="level-2"><a class="expandible" href="#"><span>Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/recommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/dase/"><span>DASE</span></a></li><li class="level-3">
 <a class="final" href="/templates/recommendation/evaluation/"><span>Evaluation Explained</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/reading-custom-events/"><span>Read Custom Events</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-data-prep/"><span>Customize Data Preparator</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-serving/"><span>Customize Serving</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/training-with-implicit-preference/"><span>Train with Implicit Preference</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/blacklist-items/"><span>Filter Recommended Items by Blacklist in Query</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/batch-e
 valuator/"><span>Batch Persistable Evaluator</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>E-Commerce Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/adjust-score/"><span>Adjust Score</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Similar Product</span></a><ul><li class="level-3"><a class="final" href="/templates/similarproduct/quickstart/"><span>Quick Start</span></a><
 /li><li class="level-3"><a class="final" href="/templates/similarproduct/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/multi-events-multi-algos/"><span>Multiple Events and Multiple Algorithms</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/return-item-properties/"><span>Returns Item Properties</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/rid-user-set-event/"><span>Get Rid of Events for Users</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/recommended-user/"><span>Recommend Users</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Classification</span><
 /a><ul><li class="level-3"><a class="final" href="/templates/classification/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/classification/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/classification/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/classification/add-algorithm/"><span>Use Alternative Algorithm</span></a></li><li class="level-3"><a class="final" href="/templates/classification/reading-custom-properties/"><span>Read Custom Properties</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Engine Template Gallery</span></a><ul><li class="level-2"><a class="final" href="/gallery/template-gallery/"><span>Browse</span></a></li><li class="level-2"><a class="final" href="/community/submit-template/"><span>Submit your Engine as a Template</span></a></li></ul></li><li class="level-1"><a class="expandible" hr
 ef="#"><span>Demo Tutorials</span></a><ul><li class="level-2"><a class="final" href="/demo/tapster/"><span>Comics Recommendation Demo</span></a></li><li class="level-2"><a class="final" href="/demo/community/"><span>Community Contributed Demo</span></a></li><li class="level-2"><a class="final" href="/demo/textclassification/"><span>Text Classification Engine Tutorial</span></a></li></ul></li><li class="level-1"><a class="expandible" href="/community/"><span>Getting Involved</span></a><ul><li class="level-2"><a class="final" href="/community/contribute-code/"><span>Contribute Code</span></a></li><li class="level-2"><a class="final" href="/community/contribute-documentation/"><span>Contribute Documentation</span></a></li><li class="level-2"><a class="final" href="/community/contribute-sdk/"><span>Contribute a SDK</span></a></li><li class="level-2"><a class="final" href="/community/contribute-webhook/"><span>Contribute a Webhook</span></a></li><li class="level-2"><a class="final" href=
 "/community/projects/"><span>Community Projects</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Help</span></a><ul><li class="level-2"><a class="final" href="/resources/faq/"><span>FAQs</span></a></li><li class="level-2"><a class="final" href="/support/"><span>Support</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Resources</span></a><ul><li class="level-2"><a class="final" href="/cli/"><span>Command-line Interface</span></a></li><li class="level-2"><a class="final" href="/resources/release/"><span>Release Cadence</span></a></li><li class="level-2"><a class="final" href="/resources/intellij/"><span>Developing Engines with IntelliJ IDEA</span></a></li><li class="level-2"><a class="final" href="/resources/upgrade/"><span>Upgrade Instructions</span></a></li><li class="level-2"><a class="final" href="/resources/glossary/"><span>Glossary</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"
 ><span>Apache Software Foundation</span></a><ul><li class="level-2"><a class="final" href="https://www.apache.org/"><span>Apache Homepage</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/licenses/"><span>License</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/sponsorship.html"><span>Sponsorship</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/thanks.html"><span>Thanks</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/security/"><span>Security</span></a></li></ul></li></ul></nav></div><div class="col-md-9 col-sm-12"><div class="content-header hidden-md hidden-lg"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">ML Tuning and Evaluation</a><span class="spacer">&gt;</span></li><li><span class="last">Choosing Evaluation Metrics</span></li></ul></div><div id="page-title"><h1>Choosing Evaluation Metrics</h1></div></div><
 div id="table-of-content-wrapper"><h5>On this page</h5><aside id="table-of-contents"><ul> <li> <a href="#defining-metric">Defining Metric</a> </li> <li> <a href="#common-metrics">Common Metrics</a> </li> </ul> </aside><hr/><a id="edit-page-link" href="https://github.com/apache/predictionio/tree/livedoc/docs/manual/source/evaluation/metricchoose.html.md"><img src="/images/icons/edit-pencil-d6c1bb3d.png"/>Edit this page</a></div><div class="content-header hidden-sm hidden-xs"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">ML Tuning and Evaluation</a><span class="spacer">&gt;</span></li><li><span class="last">Choosing Evaluation Metrics</span></li></ul></div><div id="page-title"><h1>Choosing Evaluation Metrics</h1></div></div><div class="content"> <p>The <a href="/evaluation/paramtuning/">hyperparameter tuning module</a> allows us to select the optimal engine parameter defined by a <code>Metric</code>. <code>Metric</code> determines the quality of an engine varia
 nt. We have skimmmed through the process of choosing the right <code>Metric</code> in previous sections.</p><p>This secion discusses basic evaluation metrics commonly used for classification problems. If you are more interested in knowing how to <em>implement</em> a custom metric, please skip to <a href="/evaluation/metricbuild/">the next section</a>.</p><h2 id='defining-metric' class='header-anchors'>Defining Metric</h2><p>Metric evaluates the quality of an engine by comparing engine&#39;s output (predicted result) with the original label (actual result). A engine serving better prediction should yield a higher metric score, the tuning module returns the engine parameter with the highest score. It is sometimes called <a href="http://en.wikipedia.org/wiki/Loss_function"><em>loss function</em></a> in literature, where the goal is to minimize the loss function.</p><p>During tuning, it is important for us to understand the definition of the metric, to make sure it is aligned with the p
 rediction engine&#39;s goal.</p><p>In the classificaiton template, we use <em>Accuracy</em> as our metric. <em>Accuracy</em> is defined as: the percentage of queries which the engine is able to predict the correct label.</p><h2 id='common-metrics' class='header-anchors'>Common Metrics</h2><p>We illustrate the choice of metric with the following confusion matrix. Row represents the engine predicted label, column represents the acutal label. The second row means that of the 200 testing data points, the engine predicted 60 (15 + 35 + 10) of them as label 2.0, among which 35 are correct prediction (i.e. actual label is 2.0, matches with the prediction), and 25 are wrong.</p> <table><thead> <tr> <th style="text-align: center"></th> <th style="text-align: center">Actual = 1.0</th> <th style="text-align: center">Actual = 2.0</th> <th style="text-align: center">Actual = 3.0</th> </tr> </thead><tbody> <tr> <td style="text-align: center"><strong>Predicted = 1.0</strong></td> <td style="text-a
 lign: center">30</td> <td style="text-align: center">0</td> <td style="text-align: center">60</td> </tr> <tr> <td style="text-align: center"><strong>Predicted = 2.0</strong></td> <td style="text-align: center">15</td> <td style="text-align: center">35</td> <td style="text-align: center">10</td> </tr> <tr> <td style="text-align: center"><strong>Predicted = 3.0</strong></td> <td style="text-align: center">0</td> <td style="text-align: center">0</td> <td style="text-align: center">50</td> </tr> </tbody></table> <h3 id='accuracy' class='header-anchors'>Accuracy</h3><p>Accuracy means that how many data points are predicted correctly. It is one of the simplest form of evaluation metrics. The accuracy score is # of correct points / # total = (30 + 35 + 50) / 200 = 0.575.</p><h3 id='precision' class='header-anchors'>Precision</h3><p>Precision is a metric for binary classifier which measures the correctness among all positive labels. A binary classifier gives only two output values (i.e. pos
 itive and negative). For problem where there are multiple values (3 in our example), we first have to tranform our problem into a binary classification problem. For example, we can have problem whether label = 1.0. The confusion matrix now becomes:</p> <table><thead> <tr> <th style="text-align: center"></th> <th style="text-align: center">Actual = 1.0</th> <th style="text-align: center">Actual != 1.0</th> </tr> </thead><tbody> <tr> <td style="text-align: center"><strong>Predicted = 1.0</strong></td> <td style="text-align: center">30</td> <td style="text-align: center">60</td> </tr> <tr> <td style="text-align: center"><strong>Predicted != 1.0</strong></td> <td style="text-align: center">15</td> <td style="text-align: center">95</td> </tr> </tbody></table> <p>Precision is the ratio between the number of correct positive answer (true positive) and the sum of correct positive answer (true positive) and wrong but positively labeled answer (false positive). In this case, the precision is 
 30 / (30 + 60) = ~0.3333.</p><h3 id='recall' class='header-anchors'>Recall</h3><p>Recall is a metric for binary classifier which measures how many positive labels are successfully predicted amongst all positive labels. Formally, it is the ratio between the number of correct positive answer (true positive) and the sum of correct positive answer (true positive) and wrongly negatively labeled asnwer (false negative). In this case, the recall is 30 / (30 + 15) = ~0.6667.</p><p>As we have discussed several common metrics for classification problem, we can implement them using the <code>Metric</code> class in <a href="/evaluation/metricbuild">the next section</a>.</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/" targe
 t="blank">Docs</a></li><li><a href="//github.com/apache/predictionio" target="blank">GitHub</a></li><li><a href="mailto:user-subscribe@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/contribute-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-subscribe@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 Predictio
 nIO 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="social-icons-wrapper"><a class="github-button" href="https://github.com/apache/predictionio" data-style="mega" data-count-href="/apache/predictionio/stargazers" data-count-api="/repos/apache/predictionio#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star apache/predictionio on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/predictionio/fork" data-icon="octicon-git-branch" data-style="mega" data-count-href="/apache/predictionio/network" data-count-api="/re
 pos/apache/predictionio#forks_count" data-count-aria-label="# forks on GitHub" 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(){
+<!DOCTYPE html><html><head><title>Choosing Evaluation Metrics</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Choosing Evaluation Metrics"/><link rel="canonical" href="https://predictionio.apache.org/evaluation/metricchoose/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><script src="//cdn.mathjax.o
 rg/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="search-bar-row-wrapper"><div class="container-fluid" id="search-bar-row"><div class="row"><div class="col-md-9 col-sm-11 col-xs-11
 "><div class="hidden-md hidden-lg" id="mobile-page-heading-wrapper"><p>PredictionIO Docs</p><h4>Choosing Evaluation Metrics</h4></div><h4 class="hidden-sm hidden-xs">PredictionIO Docs</h4></div><div class="col-md-3 col-sm-1 col-xs-1 hidden-md hidden-lg"><img id="left-menu-indicator" src="/images/icons/down-arrow-dfe9f7fe.png"/></div><div class="col-md-3 col-sm-12 col-xs-12 swiftype-wrapper"><div class="swiftype"><form class="search-form"><img class="search-box-toggler hidden-xs hidden-sm" src="/images/icons/search-glass-704bd4ff.png"/><div class="search-box"><img src="/images/icons/search-glass-704bd4ff.png"/><input type="text" id="st-search-input" class="st-search-input" placeholder="Search Doc..."/></div><img class="swiftype-row-hider hidden-md hidden-lg" src="/images/icons/drawer-toggle-active-fcbef12a.png"/></form></div></div><div class="mobile-left-menu-toggler hidden-md hidden-lg"></div></div></div></div><div id="page" class="container-fluid"><div class="row"><div id="left-men
 u-wrapper" class="col-md-3"><nav id="nav-main"><ul><li class="level-1"><a class="expandible" href="/"><span>Apache PredictionIO® Documentation</span></a><ul><li class="level-2"><a class="final" href="/"><span>Welcome to Apache PredictionIO®</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Started</span></a><ul><li class="level-2"><a class="final" href="/start/"><span>A Quick Intro</span></a></li><li class="level-2"><a class="final" href="/install/"><span>Installing Apache PredictionIO</span></a></li><li class="level-2"><a class="final" href="/start/download/"><span>Downloading an Engine Template</span></a></li><li class="level-2"><a class="final" href="/start/deploy/"><span>Deploying Your First Engine</span></a></li><li class="level-2"><a class="final" href="/start/customize/"><span>Customizing the Engine</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Integrating with Your App</span></a><ul><li class="leve
 l-2"><a class="final" href="/appintegration/"><span>App Integration Overview</span></a></li><li class="level-2"><a class="expandible" href="/sdk/"><span>List of SDKs</span></a><ul><li class="level-3"><a class="final" href="/sdk/java/"><span>Java & Android SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/php/"><span>PHP SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/python/"><span>Python SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/ruby/"><span>Ruby SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/community/"><span>Community Powered SDKs</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Deploying an Engine</span></a><ul><li class="level-2"><a class="final" href="/deploy/"><span>Deploying as a Web Service</span></a></li><li class="level-2"><a class="final" href="/batchpredict/"><span>Batch Predictions</span></a></li><li class="level-2"><a class="final" href="/deploy/
 monitoring/"><span>Monitoring Engine</span></a></li><li class="level-2"><a class="final" href="/deploy/engineparams/"><span>Setting Engine Parameters</span></a></li><li class="level-2"><a class="final" href="/deploy/enginevariants/"><span>Deploying Multiple Engine Variants</span></a></li><li class="level-2"><a class="final" href="/deploy/plugin/"><span>Engine Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Customizing an Engine</span></a><ul><li class="level-2"><a class="final" href="/customize/"><span>Learning DASE</span></a></li><li class="level-2"><a class="final" href="/customize/dase/"><span>Implement DASE</span></a></li><li class="level-2"><a class="final" href="/customize/troubleshooting/"><span>Troubleshooting Engine Development</span></a></li><li class="level-2"><a class="final" href="/api/current/#package"><span>Engine Scala APIs</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Collecting and 
 Analyzing Data</span></a><ul><li class="level-2"><a class="final" href="/datacollection/"><span>Event Server Overview</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventapi/"><span>Collecting Data with REST/SDKs</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventmodel/"><span>Events Modeling</span></a></li><li class="level-2"><a class="final" href="/datacollection/webhooks/"><span>Unifying Multichannel Data with Webhooks</span></a></li><li class="level-2"><a class="final" href="/datacollection/channel/"><span>Channel</span></a></li><li class="level-2"><a class="final" href="/datacollection/batchimport/"><span>Importing Data in Batch</span></a></li><li class="level-2"><a class="final" href="/datacollection/analytics/"><span>Using Analytics Tools</span></a></li><li class="level-2"><a class="final" href="/datacollection/plugin/"><span>Event Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><
 span>Choosing an Algorithm(s)</span></a><ul><li class="level-2"><a class="final" href="/algorithm/"><span>Built-in Algorithm Libraries</span></a></li><li class="level-2"><a class="final" href="/algorithm/switch/"><span>Switching to Another Algorithm</span></a></li><li class="level-2"><a class="final" href="/algorithm/multiple/"><span>Combining Multiple Algorithms</span></a></li><li class="level-2"><a class="final" href="/algorithm/custom/"><span>Adding Your Own Algorithms</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>ML Tuning and Evaluation</span></a><ul><li class="level-2"><a class="final" href="/evaluation/"><span>Overview</span></a></li><li class="level-2"><a class="final" href="/evaluation/paramtuning/"><span>Hyperparameter Tuning</span></a></li><li class="level-2"><a class="final" href="/evaluation/evaluationdashboard/"><span>Evaluation Dashboard</span></a></li><li class="level-2"><a class="final active" href="/evaluation/metricchoose/"><spa
 n>Choosing Evaluation Metrics</span></a></li><li class="level-2"><a class="final" href="/evaluation/metricbuild/"><span>Building Evaluation Metrics</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>System Architecture</span></a><ul><li class="level-2"><a class="final" href="/system/"><span>Architecture Overview</span></a></li><li class="level-2"><a class="final" href="/system/anotherdatastore/"><span>Using Another Data Store</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>PredictionIO® Official Templates</span></a><ul><li class="level-2"><a class="final" href="/templates/"><span>Intro</span></a></li><li class="level-2"><a class="expandible" href="#"><span>Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/recommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/dase/"><span>DASE</span></a></li><li class="level-3">
 <a class="final" href="/templates/recommendation/evaluation/"><span>Evaluation Explained</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/reading-custom-events/"><span>Read Custom Events</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-data-prep/"><span>Customize Data Preparator</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-serving/"><span>Customize Serving</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/training-with-implicit-preference/"><span>Train with Implicit Preference</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/blacklist-items/"><span>Filter Recommended Items by Blacklist in Query</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/batch-e
 valuator/"><span>Batch Persistable Evaluator</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>E-Commerce Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/adjust-score/"><span>Adjust Score</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Similar Product</span></a><ul><li class="level-3"><a class="final" href="/templates/similarproduct/quickstart/"><span>Quick Start</span></a><
 /li><li class="level-3"><a class="final" href="/templates/similarproduct/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/multi-events-multi-algos/"><span>Multiple Events and Multiple Algorithms</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/return-item-properties/"><span>Returns Item Properties</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/rid-user-set-event/"><span>Get Rid of Events for Users</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/recommended-user/"><span>Recommend Users</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Classification</span><
 /a><ul><li class="level-3"><a class="final" href="/templates/classification/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/classification/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/classification/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/classification/add-algorithm/"><span>Use Alternative Algorithm</span></a></li><li class="level-3"><a class="final" href="/templates/classification/reading-custom-properties/"><span>Read Custom Properties</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Engine Template Gallery</span></a><ul><li class="level-2"><a class="final" href="/gallery/template-gallery/"><span>Browse</span></a></li><li class="level-2"><a class="final" href="/community/submit-template/"><span>Submit your Engine as a Template</span></a></li></ul></li><li class="level-1"><a class="expandible" hr
 ef="#"><span>Demo Tutorials</span></a><ul><li class="level-2"><a class="final" href="/demo/tapster/"><span>Comics Recommendation Demo</span></a></li><li class="level-2"><a class="final" href="/demo/community/"><span>Community Contributed Demo</span></a></li><li class="level-2"><a class="final" href="/demo/textclassification/"><span>Text Classification Engine Tutorial</span></a></li></ul></li><li class="level-1"><a class="expandible" href="/community/"><span>Getting Involved</span></a><ul><li class="level-2"><a class="final" href="/community/contribute-code/"><span>Contribute Code</span></a></li><li class="level-2"><a class="final" href="/community/contribute-documentation/"><span>Contribute Documentation</span></a></li><li class="level-2"><a class="final" href="/community/contribute-sdk/"><span>Contribute a SDK</span></a></li><li class="level-2"><a class="final" href="/community/contribute-webhook/"><span>Contribute a Webhook</span></a></li><li class="level-2"><a class="final" href=
 "/community/projects/"><span>Community Projects</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Help</span></a><ul><li class="level-2"><a class="final" href="/resources/faq/"><span>FAQs</span></a></li><li class="level-2"><a class="final" href="/support/"><span>Support</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Resources</span></a><ul><li class="level-2"><a class="final" href="/cli/"><span>Command-line Interface</span></a></li><li class="level-2"><a class="final" href="/resources/release/"><span>Release Cadence</span></a></li><li class="level-2"><a class="final" href="/resources/intellij/"><span>Developing Engines with IntelliJ IDEA</span></a></li><li class="level-2"><a class="final" href="/resources/upgrade/"><span>Upgrade Instructions</span></a></li><li class="level-2"><a class="final" href="/resources/glossary/"><span>Glossary</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"
 ><span>Apache Software Foundation</span></a><ul><li class="level-2"><a class="final" href="https://www.apache.org/"><span>Apache Homepage</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/licenses/"><span>License</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/sponsorship.html"><span>Sponsorship</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/thanks.html"><span>Thanks</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/security/"><span>Security</span></a></li></ul></li></ul></nav></div><div class="col-md-9 col-sm-12"><div class="content-header hidden-md hidden-lg"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">ML Tuning and Evaluation</a><span class="spacer">&gt;</span></li><li><span class="last">Choosing Evaluation Metrics</span></li></ul></div><div id="page-title"><h1>Choosing Evaluation Metrics</h1></div></div><
 div id="table-of-content-wrapper"><h5>On this page</h5><aside id="table-of-contents"><ul> <li> <a href="#defining-metric">Defining Metric</a> </li> <li> <a href="#common-metrics">Common Metrics</a> </li> </ul> </aside><hr/><a id="edit-page-link" href="https://github.com/apache/predictionio/tree/livedoc/docs/manual/source/evaluation/metricchoose.html.md"><img src="/images/icons/edit-pencil-d6c1bb3d.png"/>Edit this page</a></div><div class="content-header hidden-sm hidden-xs"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">ML Tuning and Evaluation</a><span class="spacer">&gt;</span></li><li><span class="last">Choosing Evaluation Metrics</span></li></ul></div><div id="page-title"><h1>Choosing Evaluation Metrics</h1></div></div><div class="content"> <p>The <a href="/evaluation/paramtuning/">hyperparameter tuning module</a> allows us to select the optimal engine parameter defined by a <code>Metric</code>. <code>Metric</code> determines the quality of an engine varia
 nt. We have skimmed through the process of choosing the right <code>Metric</code> in previous sections.</p><p>This section discusses basic evaluation metrics commonly used for classification problems. If you are more interested in knowing how to <em>implement</em> a custom metric, please skip to <a href="/evaluation/metricbuild/">the next section</a>.</p><h2 id='defining-metric' class='header-anchors'>Defining Metric</h2><p>Metric evaluates the quality of an engine by comparing engine&#39;s output (predicted result) with the original label (actual result). A engine serving better prediction should yield a higher metric score, the tuning module returns the engine parameter with the highest score. It is sometimes called <a href="http://en.wikipedia.org/wiki/Loss_function"><em>loss function</em></a> in literature, where the goal is to minimize the loss function.</p><p>During tuning, it is important for us to understand the definition of the metric, to make sure it is aligned with the p
 rediction engine&#39;s goal.</p><p>In the classification template, we use <em>Accuracy</em> as our metric. <em>Accuracy</em> is defined as: the percentage of queries which the engine is able to predict the correct label.</p><h2 id='common-metrics' class='header-anchors'>Common Metrics</h2><p>We illustrate the choice of metric with the following confusion matrix. Row represents the engine predicted label, column represents the actual label. The second row means that of the 200 testing data points, the engine predicted 60 (15 + 35 + 10) of them as label 2.0, among which 35 are correct prediction (i.e. actual label is 2.0, matches with the prediction), and 25 are wrong.</p> <table><thead> <tr> <th style="text-align: center"></th> <th style="text-align: center">Actual = 1.0</th> <th style="text-align: center">Actual = 2.0</th> <th style="text-align: center">Actual = 3.0</th> </tr> </thead><tbody> <tr> <td style="text-align: center"><strong>Predicted = 1.0</strong></td> <td style="text-a
 lign: center">30</td> <td style="text-align: center">0</td> <td style="text-align: center">60</td> </tr> <tr> <td style="text-align: center"><strong>Predicted = 2.0</strong></td> <td style="text-align: center">15</td> <td style="text-align: center">35</td> <td style="text-align: center">10</td> </tr> <tr> <td style="text-align: center"><strong>Predicted = 3.0</strong></td> <td style="text-align: center">0</td> <td style="text-align: center">0</td> <td style="text-align: center">50</td> </tr> </tbody></table> <h3 id='accuracy' class='header-anchors'>Accuracy</h3><p>Accuracy means that how many data points are predicted correctly. It is one of the simplest form of evaluation metrics. The accuracy score is # of correct points / # total = (30 + 35 + 50) / 200 = 0.575.</p><h3 id='precision' class='header-anchors'>Precision</h3><p>Precision is a metric for binary classifier which measures the correctness among all positive labels. A binary classifier gives only two output values (i.e. pos
 itive and negative). For problem where there are multiple values (3 in our example), we first have to transform our problem into a binary classification problem. For example, we can have problem whether label = 1.0. The confusion matrix now becomes:</p> <table><thead> <tr> <th style="text-align: center"></th> <th style="text-align: center">Actual = 1.0</th> <th style="text-align: center">Actual != 1.0</th> </tr> </thead><tbody> <tr> <td style="text-align: center"><strong>Predicted = 1.0</strong></td> <td style="text-align: center">30</td> <td style="text-align: center">60</td> </tr> <tr> <td style="text-align: center"><strong>Predicted != 1.0</strong></td> <td style="text-align: center">15</td> <td style="text-align: center">95</td> </tr> </tbody></table> <p>Precision is the ratio between the number of correct positive answer (true positive) and the sum of correct positive answer (true positive) and wrong but positively labeled answer (false positive). In this case, the precision is
  30 / (30 + 60) = ~0.3333.</p><h3 id='recall' class='header-anchors'>Recall</h3><p>Recall is a metric for binary classifier which measures how many positive labels are successfully predicted amongst all positive labels. Formally, it is the ratio between the number of correct positive answer (true positive) and the sum of correct positive answer (true positive) and wrongly negatively labeled answer (false negative). In this case, the recall is 30 / (30 + 15) = ~0.6667.</p><p>As we have discussed several common metrics for classification problem, we can implement them using the <code>Metric</code> class in <a href="/evaluation/metricbuild">the next section</a>.</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/" targ
 et="blank">Docs</a></li><li><a href="//github.com/apache/predictionio" target="blank">GitHub</a></li><li><a href="mailto:user-subscribe@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/contribute-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-subscribe@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 Predicti
 onIO 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="social-icons-wrapper"><a class="github-button" href="https://github.com/apache/predictionio" data-style="mega" data-count-href="/apache/predictionio/stargazers" data-count-api="/repos/apache/predictionio#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star apache/predictionio on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/predictionio/fork" data-icon="octicon-git-branch" data-style="mega" data-count-href="/apache/predictionio/network" data-count-api="/r
 epos/apache/predictionio#forks_count" data-count-aria-label="# forks on GitHub" 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);
 e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
 })(window,document,'script','//s.swiftypecdn.com/install/v1/st.js','_st');

http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/evaluation/paramtuning/index.html
----------------------------------------------------------------------
diff --git a/evaluation/paramtuning/index.html b/evaluation/paramtuning/index.html
index 0a99ab6..f7c21ec 100644
--- a/evaluation/paramtuning/index.html
+++ b/evaluation/paramtuning/index.html
@@ -240,7 +240,7 @@ The best variant params can be found <span class="k">in </span>best.json
     <span class="o">}</span>
   <span class="o">}</span>
 <span class="o">}</span>
-</pre></td></tr></tbody></table> </div> <p>The <code>readEval</code> method returns a sequence of (<code>TrainingData</code>, <code>EvaluationInfo</code>, <code>RDD[(Query, ActualResult)]</code>. <code>TrainingData</code> is the same class we use for deploy, <code>RDD[(Query, ActualResult)]</code> is the validation set, <code>EvaluationInfo</code> can be used to hold some global evaluation data ; it is not used in the current example.</p><p>Lines 11 to 41 is the logic of reading and transforming data from the datastore; it is equvialent to the existing <code>readTraining</code> method. After line 41, the variable <code>labeledPoints</code> contains the complete dataset with which we use to generate the (training, validation) sequence.</p><p>Lines 43 to 57 is the <em>k-fold</em> logic. Line 45 gives each data point a unique id, and we decide whether the point belongs to the training or validation set depends on the <em>mod</em> of the id (lines 48 to 49). For each point in the valida
 tion set, we construct the <code>Query</code> and <code>ActualResult</code> (line 55) which is used validate the engine.</p><h2 id='evaluation-metrics' class='header-anchors'>Evaluation Metrics</h2><p>We define a <code>Metric</code> which gives a <em>score</em> to engine params. The higher the score, the better the engine params are. In this template, we use accuray score which measures the portion of correct prediction among all data points.</p><p>In MyClassification/src/main/scala/<strong>Evaluation.scala</strong>, the class <code>Accuracy</code> implements the <em>accuracy</em> score. It extends a base helper class <code>AverageMetric</code> which calculates the average score overall <em>(Query, PredictionResult, ActualResult)</em> tuple.</p><div class="highlight scala"><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>The <code>readEval</code> method returns a sequence of (<code>TrainingData</code>, <code>EvaluationInfo</code>, <code>RDD[(Query, ActualResult)]</code>. <code>TrainingData</code> is the same class we use for deploy, <code>RDD[(Query, ActualResult)]</code> is the validation set, <code>EvaluationInfo</code> can be used to hold some global evaluation data ; it is not used in the current example.</p><p>Lines 11 to 41 is the logic of reading and transforming data from the datastore; it is equvialent to the existing <code>readTraining</code> method. After line 41, the variable <code>labeledPoints</code> contains the complete dataset with which we use to generate the (training, validation) sequence.</p><p>Lines 43 to 57 is the <em>k-fold</em> logic. Line 45 gives each data point a unique id, and we decide whether the point belongs to the training or validation set depends on the <em>mod</em> of the id (lines 48 to 49). For each point in the valida
 tion set, we construct the <code>Query</code> and <code>ActualResult</code> (line 55) which is used validate the engine.</p><h2 id='evaluation-metrics' class='header-anchors'>Evaluation Metrics</h2><p>We define a <code>Metric</code> which gives a <em>score</em> to engine params. The higher the score, the better the engine params are. In this template, we use accuracy score which measures the portion of correct prediction among all data points.</p><p>In MyClassification/src/main/scala/<strong>Evaluation.scala</strong>, the class <code>Accuracy</code> implements the <em>accuracy</em> score. It extends a base helper class <code>AverageMetric</code> which calculates the average score overall <em>(Query, PredictionResult, ActualResult)</em> tuple.</p><div class="highlight scala"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -287,7 +287,7 @@ The best variant params can be found <span class="k">in </span>best.json
     <span class="n">baseEP</span><span class="o">.</span><span class="n">copy</span><span class="o">(</span><span class="n">algorithmParamsList</span> <span class="k">=</span> <span class="nc">Seq</span><span class="o">((</span><span class="s">"naive"</span><span class="o">,</span> <span class="nc">AlgorithmParams</span><span class="o">(</span><span class="mf">100.0</span><span class="o">)))),</span>
     <span class="n">baseEP</span><span class="o">.</span><span class="n">copy</span><span class="o">(</span><span class="n">algorithmParamsList</span> <span class="k">=</span> <span class="nc">Seq</span><span class="o">((</span><span class="s">"naive"</span><span class="o">,</span> <span class="nc">AlgorithmParams</span><span class="o">(</span><span class="mf">1000.0</span><span class="o">)))))</span>
 <span class="o">}</span>
-</pre></td></tr></tbody></table> </div> <p>A good practise is to first define a base engine params, it contains the common parameters used in all evaluations (lines 7 to 8). With the base params, we construct the list of engine params we want to evaluation by adding or replacing the controller parameter. Lines 13 to 16 generate 3 engine parameters, each has a different smoothing parameters.</p><h2 id='running-the-evaluation' class='header-anchors'>Running the Evaluation</h2><p>It remains to run the evaluation. Let&#39;s recap the quick start section above. The <code>pio eval</code> command kick starts the evaluation, and the result can be seen from the console.</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></tr></tbody></table> </div> <p>A good practice is to first define a base engine params, it contains the common parameters used in all evaluations (lines 7 to 8). With the base params, we construct the list of engine params we want to evaluation by adding or replacing the controller parameter. Lines 13 to 16 generate 3 engine parameters, each has a different smoothing parameters.</p><h2 id='running-the-evaluation' class='header-anchors'>Running the Evaluation</h2><p>It remains to run the evaluation. Let&#39;s recap the quick start section above. The <code>pio eval</code> command kick starts the evaluation, and the result can be seen from the console.</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</pre></td><td class="code"><pre><span class="gp">$ </span>pio build
 ...
@@ -381,7 +381,7 @@ Metrics:
   org.template.classification.Accuracy: 0.9281045751633987
 The best variant params can be found <span class="k">in </span>best.json
 <span class="o">[</span>INFO] <span class="o">[</span>CoreWorkflow<span class="nv">$]</span> runEvaluation completed
-</pre></td></tr></tbody></table> </div> <h2 id='notes' class='header-anchors'>Notes</h2> <ul> <li>We deliberately not metion <strong><em>test set</em></strong> in this hyperparameter tuning guide. In machine learning literature, the <strong><em>test set</em></strong> is a separate piece of data which is used to evaluate the final engine params outputted by the evaluation process. This guarantees that no information in the training / validation set is <em>leaked</em> into the engine params and yields a biased outcome. With PredictionIO, there are multiple ways of conducting robust tuning, we will cover this topic in the coming sections.</li> </ul> </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-subscribe@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/contribute-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-subscribe@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 log
 o 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="social-icons-wrapper"><a class="github-button" href="https://github.com/apache/predictionio" data-style="mega" data-count-href="/apache/predictionio/stargazers" data-count-api="/repos/apache/predictionio#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star apache/predictionio on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/predictionio/fork" data-icon="octicon-git-branch" data-style="mega" data-count-href="/apache/predictionio/network" data-count-api="/repos/apache/pred
 ictionio#forks_count" data-count-aria-label="# forks on GitHub" 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(){
+</pre></td></tr></tbody></table> </div> <h2 id='notes' class='header-anchors'>Notes</h2> <ul> <li>We deliberately not mention <strong><em>test set</em></strong> in this hyperparameter tuning guide. In machine learning literature, the <strong><em>test set</em></strong> is a separate piece of data which is used to evaluate the final engine params outputted by the evaluation process. This guarantees that no information in the training / validation set is <em>leaked</em> into the engine params and yields a biased outcome. With PredictionIO, there are multiple ways of conducting robust tuning, we will cover this topic in the coming sections.</li> </ul> </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-subscribe@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/contribute-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-subscribe@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 lo
 go 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="social-icons-wrapper"><a class="github-button" href="https://github.com/apache/predictionio" data-style="mega" data-count-href="/apache/predictionio/stargazers" data-count-api="/repos/apache/predictionio#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star apache/predictionio on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/predictionio/fork" data-icon="octicon-git-branch" data-style="mega" data-count-href="/apache/predictionio/network" data-count-api="/repos/apache/pre
 dictionio#forks_count" data-count-aria-label="# forks on GitHub" 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);
 e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
 })(window,document,'script','//s.swiftypecdn.com/install/v1/st.js','_st');


[08/11] predictionio-site git commit: Documentation based on apache/predictionio#54415e1066ae2d646eef62ebfdf801ace1de2097

Posted by gi...@apache.org.
http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/gallery/templates.yaml
----------------------------------------------------------------------
diff --git a/gallery/templates.yaml b/gallery/templates.yaml
index d3aae5f..e936ad5 100644
--- a/gallery/templates.yaml
+++ b/gallery/templates.yaml
@@ -227,7 +227,7 @@
     name: Viewed This Bought That
     repo: "https://github.com/vngrs/template-scala-parallel-viewedthenbought"
     description: |-
-      This Engine uses co-occurence algorithm to match viewed items to bought items. Using this engine you may predict which item the user will buy, given the item(s) browsed.
+      This Engine uses co-occurrence algorithm to match viewed items to bought items. Using this engine you may predict which item the user will buy, given the item(s) browsed.
     tags: [recommender]
     type: Parallel
     language: Scala
@@ -465,7 +465,7 @@
     name: classifier-kafka-streaming-template
     repo: "https://github.com/singsanj/classifier-kafka-streaming-template"
     description: |-
-      The template will provide a simple integration of DASE with kafka using spark streaming capabilites in order to play around with real time notification, messages ..
+      The template will provide a simple integration of DASE with kafka using spark streaming capabilities in order to play around with real time notification, messages ..
     tags: [classification]
     type: Parallel
     language: Scala

http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/resources/faq/index.html
----------------------------------------------------------------------
diff --git a/resources/faq/index.html b/resources/faq/index.html
index 23a37aa..64f16a5 100644
--- a/resources/faq/index.html
+++ b/resources/faq/index.html
@@ -84,7 +84,7 @@ Unable to connect to all storage backend(s) successfully. Please refer to error
 </span></pre></td></tr></tbody></table> </div> <p>You can check if there is any HBase-related process by running &#39;jps&#39;.</p><p>Please see <strong>How to start HBase</strong> below.</p><h3 id='q:-how-to-start-elasticsearch?' class='header-anchors'>Q: How to start Elasticsearch?</h3><p>If you followed the <a href="/install/install-sourcecode/">instructions</a> to install PredictionIO, Elasticsearch would have been installed at <code>PredictionIO/vendors/elasticsearch-x.y.z/</code> where x.y.z is the version number. To start it, run:</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>~/PredictionIO/vendors/elasticsearch-x.y.z/bin/elasticsearch
 </pre></td></tr></tbody></table> </div> <p>If you didn&#39;t use install script, please go to where Elasticsearch is installed to start it.</p><div class="alert-message info"><p>It may take some time (15 seconds or so) for Elasticsearch to become ready after you start it (wait a bit before you run <code>pio status</code> again).</p></div><h3 id='q:-how-to-start-hbase-?' class='header-anchors'>Q: How to start HBase ?</h3><p>If you followed the <a href="/install/install-sourcecode/">instructions</a> to install PredictionIO, the HBase is installed at <code>~/PredictionIO/vendors/hbase-x.y.z/</code> where x.y.z is the version number. To start it, run:</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>~/PredictionIO/vendors/hbase-x.y.z/bin/start-hbase.sh
 </pre></td></tr></tbody></table> </div> <p>If you didn&#39;t use install script, please go to where HBase is installed to start it.</p><div class="alert-message info"><p>It may take some time (15 seconds or so) for HBase to become ready after you start it (wait a bit before you run <code>pio status</code> again).</p></div><h2 id='problem-with-event-server' class='header-anchors'>Problem with Event Server</h2><h3 id='q:-how-do-i-increase-the-jvm-heap-size-of-the-event-server?' class='header-anchors'>Q: How do I increase the JVM heap size of the Event Server?</h3><p>Add the <code>JAVA_OPTS</code> environmental variable to supply JVM options, e.g.</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><span class="nv">JAVA_OPTS</span><span class="o">=</span>-Xmx16g bin/pio eventserver ...
-</pre></td></tr></tbody></table> </div> <h2 id='engine-training' class='header-anchors'>Engine Training</h2><h3 id='q:-how-to-increase-spark-driver-program-and-worker-executor-memory-size?' class='header-anchors'>Q: How to increase Spark driver program and worker executor memory size?</h3><p>In general, the PredictionIO <code>bin/pio</code> scripts wraps around Spark&#39;s <code>spark-submit</code> script. You can specify a lot of Spark configurations (i.e. executor memory, cores, master url, etc.) with it. You can supply these as pass-through arguments at the end of <code>bin/pio</code> command.</p><p>If the engine training seems stuck, it&#39;s possible that the the executor doesn&#39;t have enough memory.</p><p>First, follow <a href="http://spark.apache.org/docs/latest/spark-standalone.html">instruction here</a> to start standalone Spark cluster and get the master URL. If you use the provided quick install script to install PredictionIO, the Spark is installed at <code>Prediction
 IO/vendors/spark-1.2.0/</code> where you could run the Spark commands in <code>sbin/</code> as described in the Spark documentation. Then use following train commmand to specify executor memory (default is only 512 MB) and driver memory.</p><p>For example, the follow command set the Spark master to <code>spark://localhost:7077</code> (the default url of standalone cluster), set the driver memory to 16G and set the executor memory to 24G for <code>pio train</code>.</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 train -- --master spark://localhost:7077 --driver-memory 16G --executor-memory 24G
+</pre></td></tr></tbody></table> </div> <h2 id='engine-training' class='header-anchors'>Engine Training</h2><h3 id='q:-how-to-increase-spark-driver-program-and-worker-executor-memory-size?' class='header-anchors'>Q: How to increase Spark driver program and worker executor memory size?</h3><p>In general, the PredictionIO <code>bin/pio</code> scripts wraps around Spark&#39;s <code>spark-submit</code> script. You can specify a lot of Spark configurations (i.e. executor memory, cores, master url, etc.) with it. You can supply these as pass-through arguments at the end of <code>bin/pio</code> command.</p><p>If the engine training seems stuck, it&#39;s possible that the the executor doesn&#39;t have enough memory.</p><p>First, follow <a href="http://spark.apache.org/docs/latest/spark-standalone.html">instruction here</a> to start standalone Spark cluster and get the master URL. If you use the provided quick install script to install PredictionIO, the Spark is installed at <code>Prediction
 IO/vendors/spark-1.2.0/</code> where you could run the Spark commands in <code>sbin/</code> as described in the Spark documentation. Then use following train command to specify executor memory (default is only 512 MB) and driver memory.</p><p>For example, the follow command set the Spark master to <code>spark://localhost:7077</code> (the default url of standalone cluster), set the driver memory to 16G and set the executor memory to 24G for <code>pio train</code>.</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 train -- --master spark://localhost:7077 --driver-memory 16G --executor-memory 24G
 </pre></td></tr></tbody></table> </div> <h3 id='q:-how-to-resolve-&quot;exception-in-thread-&quot;main&quot;-org.apache.spark.sparkexception:-job-aborted-due-to-stage-failure:-serialized-task-165:35-was-110539813-bytes,-which-exceeds-max-allowed:-spark.akka.framesize-(10485760-bytes)---reserved-(204800-bytes).-consider-increasing-spark.akka.framesize-or-using-broadcast-variables-for-large-values.&quot;?' class='header-anchors'>Q: How to resolve &quot;Exception in thread &quot;main&quot; org.apache.spark.SparkException: Job aborted due to stage failure: Serialized task 165:35 was 110539813 bytes, which exceeds max allowed: spark.akka.frameSize (10485760 bytes) - reserved (204800 bytes). Consider increasing spark.akka.frameSize or using broadcast variables for large values.&quot;?</h3><p>A likely reason is the local algorithm model is larger than the default frame size. You can specify a larger value as a pass-thru argument to spark-submit when you <code>pio train</code>. The followin
 g command increase the frameSize to 1024MB.</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 train -- --conf spark.akka.frameSize<span class="o">=</span>1024
 </pre></td></tr></tbody></table> </div> <h2 id='deploy-engine' class='header-anchors'>Deploy Engine</h2><h3 id='q:-how-to-increase-heap-space-memory-for-&quot;pio-deploy&quot;?' class='header-anchors'>Q: How to increase heap space memory for &quot;pio deploy&quot;?</h3><p>If you see the following error during <code>pio deploy</code>, it means there is not enough heap space memory.</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

http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/samples/tabs/index.html
----------------------------------------------------------------------
diff --git a/samples/tabs/index.html b/samples/tabs/index.html
index 2e9154c..980f13f 100644
--- a/samples/tabs/index.html
+++ b/samples/tabs/index.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><title>Tabs</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Tabs"/><link rel="canonical" href="https://predictionio.apache.org/samples/tabs/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><script src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
 "></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="search-bar-row-wrapper"><div class="container-fluid" id="search-bar-row"><div class="row"><div class="col-md-9 col-sm-11 col-xs-11"><div class="hidden-md hidden-lg" id="mobile-page-headin
 g-wrapper"><p>PredictionIO Docs</p><h4>Tabs</h4></div><h4 class="hidden-sm hidden-xs">PredictionIO Docs</h4></div><div class="col-md-3 col-sm-1 col-xs-1 hidden-md hidden-lg"><img id="left-menu-indicator" src="/images/icons/down-arrow-dfe9f7fe.png"/></div><div class="col-md-3 col-sm-12 col-xs-12 swiftype-wrapper"><div class="swiftype"><form class="search-form"><img class="search-box-toggler hidden-xs hidden-sm" src="/images/icons/search-glass-704bd4ff.png"/><div class="search-box"><img src="/images/icons/search-glass-704bd4ff.png"/><input type="text" id="st-search-input" class="st-search-input" placeholder="Search Doc..."/></div><img class="swiftype-row-hider hidden-md hidden-lg" src="/images/icons/drawer-toggle-active-fcbef12a.png"/></form></div></div><div class="mobile-left-menu-toggler hidden-md hidden-lg"></div></div></div></div><div id="page" class="container-fluid"><div class="row"><div id="left-menu-wrapper" class="col-md-3"><nav id="nav-main"><ul><li class="level-1"><a class=
 "expandible" href="/"><span>Apache PredictionIO® Documentation</span></a><ul><li class="level-2"><a class="final" href="/"><span>Welcome to Apache PredictionIO®</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Started</span></a><ul><li class="level-2"><a class="final" href="/start/"><span>A Quick Intro</span></a></li><li class="level-2"><a class="final" href="/install/"><span>Installing Apache PredictionIO</span></a></li><li class="level-2"><a class="final" href="/start/download/"><span>Downloading an Engine Template</span></a></li><li class="level-2"><a class="final" href="/start/deploy/"><span>Deploying Your First Engine</span></a></li><li class="level-2"><a class="final" href="/start/customize/"><span>Customizing the Engine</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Integrating with Your App</span></a><ul><li class="level-2"><a class="final" href="/appintegration/"><span>App Integration Overview</sp
 an></a></li><li class="level-2"><a class="expandible" href="/sdk/"><span>List of SDKs</span></a><ul><li class="level-3"><a class="final" href="/sdk/java/"><span>Java & Android SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/php/"><span>PHP SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/python/"><span>Python SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/ruby/"><span>Ruby SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/community/"><span>Community Powered SDKs</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Deploying an Engine</span></a><ul><li class="level-2"><a class="final" href="/deploy/"><span>Deploying as a Web Service</span></a></li><li class="level-2"><a class="final" href="/batchpredict/"><span>Batch Predictions</span></a></li><li class="level-2"><a class="final" href="/deploy/monitoring/"><span>Monitoring Engine</span></a></li><li class="level-2"><a class
 ="final" href="/deploy/engineparams/"><span>Setting Engine Parameters</span></a></li><li class="level-2"><a class="final" href="/deploy/enginevariants/"><span>Deploying Multiple Engine Variants</span></a></li><li class="level-2"><a class="final" href="/deploy/plugin/"><span>Engine Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Customizing an Engine</span></a><ul><li class="level-2"><a class="final" href="/customize/"><span>Learning DASE</span></a></li><li class="level-2"><a class="final" href="/customize/dase/"><span>Implement DASE</span></a></li><li class="level-2"><a class="final" href="/customize/troubleshooting/"><span>Troubleshooting Engine Development</span></a></li><li class="level-2"><a class="final" href="/api/current/#package"><span>Engine Scala APIs</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Collecting and Analyzing Data</span></a><ul><li class="level-2"><a class="final" href="/datacol
 lection/"><span>Event Server Overview</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventapi/"><span>Collecting Data with REST/SDKs</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventmodel/"><span>Events Modeling</span></a></li><li class="level-2"><a class="final" href="/datacollection/webhooks/"><span>Unifying Multichannel Data with Webhooks</span></a></li><li class="level-2"><a class="final" href="/datacollection/channel/"><span>Channel</span></a></li><li class="level-2"><a class="final" href="/datacollection/batchimport/"><span>Importing Data in Batch</span></a></li><li class="level-2"><a class="final" href="/datacollection/analytics/"><span>Using Analytics Tools</span></a></li><li class="level-2"><a class="final" href="/datacollection/plugin/"><span>Event Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Choosing an Algorithm(s)</span></a><ul><li class="level-2"><a class="final"
  href="/algorithm/"><span>Built-in Algorithm Libraries</span></a></li><li class="level-2"><a class="final" href="/algorithm/switch/"><span>Switching to Another Algorithm</span></a></li><li class="level-2"><a class="final" href="/algorithm/multiple/"><span>Combining Multiple Algorithms</span></a></li><li class="level-2"><a class="final" href="/algorithm/custom/"><span>Adding Your Own Algorithms</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>ML Tuning and Evaluation</span></a><ul><li class="level-2"><a class="final" href="/evaluation/"><span>Overview</span></a></li><li class="level-2"><a class="final" href="/evaluation/paramtuning/"><span>Hyperparameter Tuning</span></a></li><li class="level-2"><a class="final" href="/evaluation/evaluationdashboard/"><span>Evaluation Dashboard</span></a></li><li class="level-2"><a class="final" href="/evaluation/metricchoose/"><span>Choosing Evaluation Metrics</span></a></li><li class="level-2"><a class="final" href=
 "/evaluation/metricbuild/"><span>Building Evaluation Metrics</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>System Architecture</span></a><ul><li class="level-2"><a class="final" href="/system/"><span>Architecture Overview</span></a></li><li class="level-2"><a class="final" href="/system/anotherdatastore/"><span>Using Another Data Store</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>PredictionIO® Official Templates</span></a><ul><li class="level-2"><a class="final" href="/templates/"><span>Intro</span></a></li><li class="level-2"><a class="expandible" href="#"><span>Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/recommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/evaluation/"><span>Evaluation Explaine
 d</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/reading-custom-events/"><span>Read Custom Events</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-data-prep/"><span>Customize Data Preparator</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-serving/"><span>Customize Serving</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/training-with-implicit-preference/"><span>Train with Implicit Preference</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/blacklist-items/"><span>Filter Recommended Items by Blacklist in Query</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/batch-evaluator/"><span>Batch Persistable Evaluator</span></a></li></ul></li><li class="level-
 2"><a class="expandible" href="#"><span>E-Commerce Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/adjust-score/"><span>Adjust Score</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Similar Product</span></a><ul><li class="level-3"><a class="final" href="/templates/similarproduct/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/dase/"><span>D
 ASE</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/multi-events-multi-algos/"><span>Multiple Events and Multiple Algorithms</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/return-item-properties/"><span>Returns Item Properties</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/rid-user-set-event/"><span>Get Rid of Events for Users</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/recommended-user/"><span>Recommend Users</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Classification</span></a><ul><li class="level-3"><a class="final" href="/templates/classification/quickstart/
 "><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/classification/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/classification/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/classification/add-algorithm/"><span>Use Alternative Algorithm</span></a></li><li class="level-3"><a class="final" href="/templates/classification/reading-custom-properties/"><span>Read Custom Properties</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Engine Template Gallery</span></a><ul><li class="level-2"><a class="final" href="/gallery/template-gallery/"><span>Browse</span></a></li><li class="level-2"><a class="final" href="/community/submit-template/"><span>Submit your Engine as a Template</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Demo Tutorials</span></a><ul><li class="level-2"><a class="final" href="/d
 emo/tapster/"><span>Comics Recommendation Demo</span></a></li><li class="level-2"><a class="final" href="/demo/community/"><span>Community Contributed Demo</span></a></li><li class="level-2"><a class="final" href="/demo/textclassification/"><span>Text Classification Engine Tutorial</span></a></li></ul></li><li class="level-1"><a class="expandible" href="/community/"><span>Getting Involved</span></a><ul><li class="level-2"><a class="final" href="/community/contribute-code/"><span>Contribute Code</span></a></li><li class="level-2"><a class="final" href="/community/contribute-documentation/"><span>Contribute Documentation</span></a></li><li class="level-2"><a class="final" href="/community/contribute-sdk/"><span>Contribute a SDK</span></a></li><li class="level-2"><a class="final" href="/community/contribute-webhook/"><span>Contribute a Webhook</span></a></li><li class="level-2"><a class="final" href="/community/projects/"><span>Community Projects</span></a></li></ul></li><li class="lev
 el-1"><a class="expandible" href="#"><span>Getting Help</span></a><ul><li class="level-2"><a class="final" href="/resources/faq/"><span>FAQs</span></a></li><li class="level-2"><a class="final" href="/support/"><span>Support</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Resources</span></a><ul><li class="level-2"><a class="final" href="/cli/"><span>Command-line Interface</span></a></li><li class="level-2"><a class="final" href="/resources/release/"><span>Release Cadence</span></a></li><li class="level-2"><a class="final" href="/resources/intellij/"><span>Developing Engines with IntelliJ IDEA</span></a></li><li class="level-2"><a class="final" href="/resources/upgrade/"><span>Upgrade Instructions</span></a></li><li class="level-2"><a class="final" href="/resources/glossary/"><span>Glossary</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Apache Software Foundation</span></a><ul><li class="level-2"><a class="final" hr
 ef="https://www.apache.org/"><span>Apache Homepage</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/licenses/"><span>License</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/sponsorship.html"><span>Sponsorship</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/thanks.html"><span>Thanks</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/security/"><span>Security</span></a></li></ul></li></ul></nav></div><div class="col-md-9 col-sm-12"><div class="content-header hidden-md hidden-lg"><div id="page-title"><h1>Tabs</h1></div></div><div id="table-of-content-wrapper"><h5>On this page</h5><aside id="table-of-contents"><ul> <li> <a href="#test-syncing">Test Syncing</a> </li> </ul> </aside><hr/><a id="edit-page-link" href="https://github.com/apache/predictionio/tree/livedoc/docs/manual/source/samples/tabs.html.md"><img src="/images/icons/edit-pencil
 -d6c1bb3d.png"/>Edit this page</a></div><div class="content-header hidden-sm hidden-xs"><div id="page-title"><h1>Tabs</h1></div></div><div class="content"> <p>This page is used to test the tabs plugin based on <a href="https://github.com/vdw/Tabslet">Tabslet</a>.</p><div class="tabs"> <ul class="control"> <li data-lang="ruby"><a href="#tab-62584590-5a43-4ddc-8e4e-273c8e3f6a1a">Ruby</a></li> <li data-lang=""><a href="#tab-12848738-5485-4315-b4e7-4753f14006d2">Plain</a></li> <li data-lang="html"><a href="#tab-081440fd-41de-49b0-932f-8972ad1cceb6">HTML</a></li> <li data-lang=""><a href="#tab-d599f1ac-445f-4019-a18b-793efedfdb92">Test</a></li> </ul> <div data-tab="Ruby" data-lang="ruby" id="tab-62584590-5a43-4ddc-8e4e-273c8e3f6a1a"> <div class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
+<!DOCTYPE html><html><head><title>Tabs</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Tabs"/><link rel="canonical" href="https://predictionio.apache.org/samples/tabs/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><script src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
 "></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="search-bar-row-wrapper"><div class="container-fluid" id="search-bar-row"><div class="row"><div class="col-md-9 col-sm-11 col-xs-11"><div class="hidden-md hidden-lg" id="mobile-page-headin
 g-wrapper"><p>PredictionIO Docs</p><h4>Tabs</h4></div><h4 class="hidden-sm hidden-xs">PredictionIO Docs</h4></div><div class="col-md-3 col-sm-1 col-xs-1 hidden-md hidden-lg"><img id="left-menu-indicator" src="/images/icons/down-arrow-dfe9f7fe.png"/></div><div class="col-md-3 col-sm-12 col-xs-12 swiftype-wrapper"><div class="swiftype"><form class="search-form"><img class="search-box-toggler hidden-xs hidden-sm" src="/images/icons/search-glass-704bd4ff.png"/><div class="search-box"><img src="/images/icons/search-glass-704bd4ff.png"/><input type="text" id="st-search-input" class="st-search-input" placeholder="Search Doc..."/></div><img class="swiftype-row-hider hidden-md hidden-lg" src="/images/icons/drawer-toggle-active-fcbef12a.png"/></form></div></div><div class="mobile-left-menu-toggler hidden-md hidden-lg"></div></div></div></div><div id="page" class="container-fluid"><div class="row"><div id="left-menu-wrapper" class="col-md-3"><nav id="nav-main"><ul><li class="level-1"><a class=
 "expandible" href="/"><span>Apache PredictionIO® Documentation</span></a><ul><li class="level-2"><a class="final" href="/"><span>Welcome to Apache PredictionIO®</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Started</span></a><ul><li class="level-2"><a class="final" href="/start/"><span>A Quick Intro</span></a></li><li class="level-2"><a class="final" href="/install/"><span>Installing Apache PredictionIO</span></a></li><li class="level-2"><a class="final" href="/start/download/"><span>Downloading an Engine Template</span></a></li><li class="level-2"><a class="final" href="/start/deploy/"><span>Deploying Your First Engine</span></a></li><li class="level-2"><a class="final" href="/start/customize/"><span>Customizing the Engine</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Integrating with Your App</span></a><ul><li class="level-2"><a class="final" href="/appintegration/"><span>App Integration Overview</sp
 an></a></li><li class="level-2"><a class="expandible" href="/sdk/"><span>List of SDKs</span></a><ul><li class="level-3"><a class="final" href="/sdk/java/"><span>Java & Android SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/php/"><span>PHP SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/python/"><span>Python SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/ruby/"><span>Ruby SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/community/"><span>Community Powered SDKs</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Deploying an Engine</span></a><ul><li class="level-2"><a class="final" href="/deploy/"><span>Deploying as a Web Service</span></a></li><li class="level-2"><a class="final" href="/batchpredict/"><span>Batch Predictions</span></a></li><li class="level-2"><a class="final" href="/deploy/monitoring/"><span>Monitoring Engine</span></a></li><li class="level-2"><a class
 ="final" href="/deploy/engineparams/"><span>Setting Engine Parameters</span></a></li><li class="level-2"><a class="final" href="/deploy/enginevariants/"><span>Deploying Multiple Engine Variants</span></a></li><li class="level-2"><a class="final" href="/deploy/plugin/"><span>Engine Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Customizing an Engine</span></a><ul><li class="level-2"><a class="final" href="/customize/"><span>Learning DASE</span></a></li><li class="level-2"><a class="final" href="/customize/dase/"><span>Implement DASE</span></a></li><li class="level-2"><a class="final" href="/customize/troubleshooting/"><span>Troubleshooting Engine Development</span></a></li><li class="level-2"><a class="final" href="/api/current/#package"><span>Engine Scala APIs</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Collecting and Analyzing Data</span></a><ul><li class="level-2"><a class="final" href="/datacol
 lection/"><span>Event Server Overview</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventapi/"><span>Collecting Data with REST/SDKs</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventmodel/"><span>Events Modeling</span></a></li><li class="level-2"><a class="final" href="/datacollection/webhooks/"><span>Unifying Multichannel Data with Webhooks</span></a></li><li class="level-2"><a class="final" href="/datacollection/channel/"><span>Channel</span></a></li><li class="level-2"><a class="final" href="/datacollection/batchimport/"><span>Importing Data in Batch</span></a></li><li class="level-2"><a class="final" href="/datacollection/analytics/"><span>Using Analytics Tools</span></a></li><li class="level-2"><a class="final" href="/datacollection/plugin/"><span>Event Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Choosing an Algorithm(s)</span></a><ul><li class="level-2"><a class="final"
  href="/algorithm/"><span>Built-in Algorithm Libraries</span></a></li><li class="level-2"><a class="final" href="/algorithm/switch/"><span>Switching to Another Algorithm</span></a></li><li class="level-2"><a class="final" href="/algorithm/multiple/"><span>Combining Multiple Algorithms</span></a></li><li class="level-2"><a class="final" href="/algorithm/custom/"><span>Adding Your Own Algorithms</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>ML Tuning and Evaluation</span></a><ul><li class="level-2"><a class="final" href="/evaluation/"><span>Overview</span></a></li><li class="level-2"><a class="final" href="/evaluation/paramtuning/"><span>Hyperparameter Tuning</span></a></li><li class="level-2"><a class="final" href="/evaluation/evaluationdashboard/"><span>Evaluation Dashboard</span></a></li><li class="level-2"><a class="final" href="/evaluation/metricchoose/"><span>Choosing Evaluation Metrics</span></a></li><li class="level-2"><a class="final" href=
 "/evaluation/metricbuild/"><span>Building Evaluation Metrics</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>System Architecture</span></a><ul><li class="level-2"><a class="final" href="/system/"><span>Architecture Overview</span></a></li><li class="level-2"><a class="final" href="/system/anotherdatastore/"><span>Using Another Data Store</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>PredictionIO® Official Templates</span></a><ul><li class="level-2"><a class="final" href="/templates/"><span>Intro</span></a></li><li class="level-2"><a class="expandible" href="#"><span>Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/recommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/evaluation/"><span>Evaluation Explaine
 d</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/reading-custom-events/"><span>Read Custom Events</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-data-prep/"><span>Customize Data Preparator</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-serving/"><span>Customize Serving</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/training-with-implicit-preference/"><span>Train with Implicit Preference</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/blacklist-items/"><span>Filter Recommended Items by Blacklist in Query</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/batch-evaluator/"><span>Batch Persistable Evaluator</span></a></li></ul></li><li class="level-
 2"><a class="expandible" href="#"><span>E-Commerce Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/adjust-score/"><span>Adjust Score</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Similar Product</span></a><ul><li class="level-3"><a class="final" href="/templates/similarproduct/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/dase/"><span>D
 ASE</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/multi-events-multi-algos/"><span>Multiple Events and Multiple Algorithms</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/return-item-properties/"><span>Returns Item Properties</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/rid-user-set-event/"><span>Get Rid of Events for Users</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/recommended-user/"><span>Recommend Users</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Classification</span></a><ul><li class="level-3"><a class="final" href="/templates/classification/quickstart/
 "><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/classification/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/classification/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/classification/add-algorithm/"><span>Use Alternative Algorithm</span></a></li><li class="level-3"><a class="final" href="/templates/classification/reading-custom-properties/"><span>Read Custom Properties</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Engine Template Gallery</span></a><ul><li class="level-2"><a class="final" href="/gallery/template-gallery/"><span>Browse</span></a></li><li class="level-2"><a class="final" href="/community/submit-template/"><span>Submit your Engine as a Template</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Demo Tutorials</span></a><ul><li class="level-2"><a class="final" href="/d
 emo/tapster/"><span>Comics Recommendation Demo</span></a></li><li class="level-2"><a class="final" href="/demo/community/"><span>Community Contributed Demo</span></a></li><li class="level-2"><a class="final" href="/demo/textclassification/"><span>Text Classification Engine Tutorial</span></a></li></ul></li><li class="level-1"><a class="expandible" href="/community/"><span>Getting Involved</span></a><ul><li class="level-2"><a class="final" href="/community/contribute-code/"><span>Contribute Code</span></a></li><li class="level-2"><a class="final" href="/community/contribute-documentation/"><span>Contribute Documentation</span></a></li><li class="level-2"><a class="final" href="/community/contribute-sdk/"><span>Contribute a SDK</span></a></li><li class="level-2"><a class="final" href="/community/contribute-webhook/"><span>Contribute a Webhook</span></a></li><li class="level-2"><a class="final" href="/community/projects/"><span>Community Projects</span></a></li></ul></li><li class="lev
 el-1"><a class="expandible" href="#"><span>Getting Help</span></a><ul><li class="level-2"><a class="final" href="/resources/faq/"><span>FAQs</span></a></li><li class="level-2"><a class="final" href="/support/"><span>Support</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Resources</span></a><ul><li class="level-2"><a class="final" href="/cli/"><span>Command-line Interface</span></a></li><li class="level-2"><a class="final" href="/resources/release/"><span>Release Cadence</span></a></li><li class="level-2"><a class="final" href="/resources/intellij/"><span>Developing Engines with IntelliJ IDEA</span></a></li><li class="level-2"><a class="final" href="/resources/upgrade/"><span>Upgrade Instructions</span></a></li><li class="level-2"><a class="final" href="/resources/glossary/"><span>Glossary</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Apache Software Foundation</span></a><ul><li class="level-2"><a class="final" hr
 ef="https://www.apache.org/"><span>Apache Homepage</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/licenses/"><span>License</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/sponsorship.html"><span>Sponsorship</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/thanks.html"><span>Thanks</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/security/"><span>Security</span></a></li></ul></li></ul></nav></div><div class="col-md-9 col-sm-12"><div class="content-header hidden-md hidden-lg"><div id="page-title"><h1>Tabs</h1></div></div><div id="table-of-content-wrapper"><h5>On this page</h5><aside id="table-of-contents"><ul> <li> <a href="#test-syncing">Test Syncing</a> </li> </ul> </aside><hr/><a id="edit-page-link" href="https://github.com/apache/predictionio/tree/livedoc/docs/manual/source/samples/tabs.html.md"><img src="/images/icons/edit-pencil
 -d6c1bb3d.png"/>Edit this page</a></div><div class="content-header hidden-sm hidden-xs"><div id="page-title"><h1>Tabs</h1></div></div><div class="content"> <p>This page is used to test the tabs plugin based on <a href="https://github.com/vdw/Tabslet">Tabslet</a>.</p><div class="tabs"> <ul class="control"> <li data-lang="ruby"><a href="#tab-43ccbbd1-464f-410e-b873-265bb8cc21ba">Ruby</a></li> <li data-lang=""><a href="#tab-4bd75c30-e773-4796-a0c0-7995b5078c5d">Plain</a></li> <li data-lang="html"><a href="#tab-a5082d33-c0ad-4370-a581-60a2c6dcb593">HTML</a></li> <li data-lang=""><a href="#tab-f034150c-4810-4a1f-b4ed-3c38aa67efc8">Test</a></li> </ul> <div data-tab="Ruby" data-lang="ruby" id="tab-43ccbbd1-464f-410e-b873-265bb8cc21ba"> <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
@@ -9,11 +9,11 @@
     <span class="s1">'bar'</span>
   <span class="k">end</span>
 <span class="k">end</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Plain" id="tab-12848738-5485-4315-b4e7-4753f14006d2"> This is a test of **markdown** inside a tab! <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="Plain" id="tab-4bd75c30-e773-4796-a0c0-7995b5078c5d"> This is a test of **markdown** inside a tab! <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>// This tab does not have the data-lang attribute <span class="nb">set</span>!
 <span class="gp">$ </span><span class="nb">cd </span>path/to/your/file
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="HTML" data-lang="html" id="tab-081440fd-41de-49b0-932f-8972ad1cceb6"> <div class="highlight html"> <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="nt">&lt;p&gt;</span>Yes you can still use HTML in code blocks!<span class="nt">&lt;/p&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Test" id="tab-d599f1ac-445f-4019-a18b-793efedfdb92"> <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="HTML" data-lang="html" id="tab-a5082d33-c0ad-4370-a581-60a2c6dcb593"> <div class="highlight html"> <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="nt">&lt;p&gt;</span>Yes you can still use HTML in code blocks!<span class="nt">&lt;/p&gt;</span>
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Test" id="tab-f034150c-4810-4a1f-b4ed-3c38aa67efc8"> <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
@@ -28,7 +28,7 @@ Test</span> <span class="na">5 =</span><span class="err">&gt;
 </span><span class="s">Test</span> <span class="na">6</span> <span class="err">&lt;=</span>
 <span class="na">Test</span> <span class="na">7</span> <span class="err">&lt;</span><span class="nt">&gt;</span>
 <span class="nt">&lt;p&gt;&lt;b&gt;</span>Test<span class="nt">&lt;/b&gt;&lt;/p&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <h2 id='test-syncing' class='header-anchors'>Test Syncing</h2><p>Here we show a similar set of tabs to test language syncing:</p><div class="tabs"> <ul class="control"> <li data-lang="ruby"><a href="#tab-d22e5fae-3892-49f6-946e-71dbc59fc87e">Ruby</a></li> <li data-lang=""><a href="#tab-8ee2442d-4686-4ebf-acbf-9aaedaaf6033">Plain</a></li> <li data-lang="html"><a href="#tab-0ea9272a-9897-459f-a0b0-3ad91baf0bf2">HTML</a></li> <li data-lang="python"><a href="#tab-76ca9616-4a86-4b83-a509-fcd673d96089">Python</a></li> </ul> <div data-tab="Ruby" data-lang="ruby" id="tab-d22e5fae-3892-49f6-946e-71dbc59fc87e"> <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> <h2 id='test-syncing' class='header-anchors'>Test Syncing</h2><p>Here we show a similar set of tabs to test language syncing:</p><div class="tabs"> <ul class="control"> <li data-lang="ruby"><a href="#tab-55c551d7-9ae3-49ca-8380-6359e0ae31c1">Ruby</a></li> <li data-lang=""><a href="#tab-5cf9e728-c5b5-4894-a5df-ba0a050661fc">Plain</a></li> <li data-lang="html"><a href="#tab-2eab0fd2-641e-4379-89a6-9dd5acdb8d37">HTML</a></li> <li data-lang="python"><a href="#tab-55422ac5-d3bf-4877-90c2-d1feea9e6d5e">Python</a></li> </ul> <div data-tab="Ruby" data-lang="ruby" id="tab-55c551d7-9ae3-49ca-8380-6359e0ae31c1"> <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
@@ -39,12 +39,12 @@ Test</span> <span class="na">5 =</span><span class="err">&gt;
     <span class="s1">'bar'</span>
   <span class="k">end</span>
 <span class="k">end</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Plain" id="tab-8ee2442d-4686-4ebf-acbf-9aaedaaf6033"> This is a test of **markdown** inside a tab! <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="Plain" id="tab-5cf9e728-c5b5-4894-a5df-ba0a050661fc"> This is a test of **markdown** inside a tab! <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>// This tab does not have the data-lang attribute <span class="nb">set</span>!
 <span class="gp">$ </span><span class="nb">cd </span>path/to/your/file
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="HTML" data-lang="html" id="tab-0ea9272a-9897-459f-a0b0-3ad91baf0bf2"> <p>This HTML is <b>hard coded</b>.</p> </div> <div data-tab="Python" data-lang="python" id="tab-76ca9616-4a86-4b83-a509-fcd673d96089"> <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> <td class="code"><pre><span class="c"># The other group does not have a Python tab.</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <div class="tabs"> <ul class="control"> <li data-lang="java"><a href="#tab-57a88fb3-b182-442c-9b45-83b2d164364c">Java</a></li> <li data-lang="html"><a href="#tab-e5856b75-c4af-45cd-bbae-313ccc4f2375">HTML</a></li> </ul> <div data-tab="Java" data-lang="java" id="tab-57a88fb3-b182-442c-9b45-83b2d164364c"> <div class="highlight plaintext"> <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>// Java code..
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="HTML" data-lang="html" id="tab-e5856b75-c4af-45cd-bbae-313ccc4f2375"> This includes **bold** with Markdown. </div> </div> </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-subscribe@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-subscribe@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-style="mega" data-count-href="/apache/predictionio/stargazers" data-count-api="/repos/apache/predictionio#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star apache/predictionio on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/predictionio/fork" data-icon="octicon-git-branch" data-style="mega" data-count-href="/apache/predictionio/network" data-count-api="/repos/apache/predictionio#forks_count" data-count-aria-label="# forks on GitHub" 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/ico
 ns/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(){
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="HTML" data-lang="html" id="tab-2eab0fd2-641e-4379-89a6-9dd5acdb8d37"> <p>This HTML is <b>hard coded</b>.</p> </div> <div data-tab="Python" data-lang="python" id="tab-55422ac5-d3bf-4877-90c2-d1feea9e6d5e"> <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> <td class="code"><pre><span class="c"># The other group does not have a Python tab.</span>
+</pre></td> </tr></tbody></table> </div> </div> </div> <div class="tabs"> <ul class="control"> <li data-lang="java"><a href="#tab-fe807bc6-6bda-4448-8ef6-6ef88033d768">Java</a></li> <li data-lang="html"><a href="#tab-59200c3c-4259-4388-bda6-7730c157355b">HTML</a></li> </ul> <div data-tab="Java" data-lang="java" id="tab-fe807bc6-6bda-4448-8ef6-6ef88033d768"> <div class="highlight plaintext"> <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>// Java code..
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="HTML" data-lang="html" id="tab-59200c3c-4259-4388-bda6-7730c157355b"> This includes **bold** with Markdown. </div> </div> </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-subscribe@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-subscribe@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-style="mega" data-count-href="/apache/predictionio/stargazers" data-count-api="/repos/apache/predictionio#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star apache/predictionio on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/predictionio/fork" data-icon="octicon-git-branch" data-style="mega" data-count-href="/apache/predictionio/network" data-count-api="/repos/apache/predictionio#forks_count" data-count-aria-label="# forks on GitHub" 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/ico
 ns/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);
 e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
 })(window,document,'script','//s.swiftypecdn.com/install/v1/st.js','_st');


[04/11] predictionio-site git commit: Documentation based on apache/predictionio#54415e1066ae2d646eef62ebfdf801ace1de2097

Posted by gi...@apache.org.
http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/templates/productranking/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/productranking/quickstart/index.html b/templates/productranking/quickstart/index.html
index 8c2bb6f..3e9ee50 100644
--- a/templates/productranking/quickstart/index.html
+++ b/templates/productranking/quickstart/index.html
@@ -32,7 +32,7 @@ Your system is all ready to go.
 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span>               MyApp1 |    1 | 3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F | <span class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span>               MyApp2 |    2 | io5lz6Eg4m3Xe4JZTBFE13GMAf1dhFl6ZteuJfrO84XpdOz9wRCrDU44EUaYuXq5 | <span class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span> Finished listing 2 app<span class="o">(</span>s<span class="o">)</span>.
-</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, let&#39;s collect some training data for the app of this Engine. By default, the Product Ranking Engine Template supports 2 types of entities: <strong>user</strong> and <strong>item</strong>, and event <strong>view</strong>. A user can view an item. This template requires &#39;$set&#39; user event, &#39;$set&#39; item event and user-view-item events.</p> <p>You can send these events to PredictionIO Event Server in real-time easily by making a HTTP request or through the provided SDK. Please see <a href="/appintegration/">App Integration Overview</a> for more details how to integrate your app with SDK.</p><p>Let&#39;s try sending events to EventServer with the following <code>curl</code> commands (The corresponding SDK code is showed in other tabs).</p><p>Replace <code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in above steps. 
 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-f6c7ce95-0cf0-45b3-a2fb-ae39a3f662ac">REST API</a></li> <li data-lang="python"><a href="#tab-316df7bc-9424-4830-ba9f-c6d4aee0cafd">Python SDK</a></li> <li data-lang="php"><a href="#tab-b44618aa-c555-43cb-bfda-016e49ffdbe2">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-8764afe4-ca50-4c6b-8ceb-4519fc045f35">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-c9f5bff6-c898-45f6
 -ab1f-0ec3fd6ca056">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-f6c7ce95-0cf0-45b3-a2fb-ae39a3f662ac"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, let&#39;s collect some training data for the app of this Engine. By default, the Product Ranking Engine Template supports 2 types of entities: <strong>user</strong> and <strong>item</strong>, and event <strong>view</strong>. A user can view an item. This template requires &#39;$set&#39; user event, &#39;$set&#39; item event and user-view-item events.</p> <p>You can send these events to PredictionIO Event Server in real-time easily by making a HTTP request or through the provided SDK. Please see <a href="/appintegration/">App Integration Overview</a> for more details how to integrate your app with SDK.</p><p>Let&#39;s try sending events to EventServer with the following <code>curl</code> commands (The corresponding SDK code is showed in other tabs).</p><p>Replace <code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in above steps. 
 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-a870a4b2-9b66-4d27-ba2f-b0b5b77a9b80">REST API</a></li> <li data-lang="python"><a href="#tab-465b7cf9-5be4-4634-b934-5bbbe0df0a84">Python SDK</a></li> <li data-lang="php"><a href="#tab-804a0f50-54f6-4cfb-8825-aec74c5517c7">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-6c5fee9e-50a1-4e82-8cec-5c06be2d7aaa">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-61197684-19e5-4206
 -ae56-3792784c5600">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-a870a4b2-9b66-4d27-ba2f-b0b5b77a9b80"> <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-316df7bc-9424-4830-ba9f-c6d4aee0cafd"> <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-465b7cf9-5be4-4634-b934-5bbbe0df0a84"> <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-b44618aa-c555-43cb-bfda-016e49ffdbe2"> <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-804a0f50-54f6-4cfb-8825-aec74c5517c7"> <div class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -103,7 +103,7 @@ Your system is all ready to go.
   <span class="s1">'entityId'</span> <span class="o">=&gt;</span> <span class="o">&lt;</span><span class="nx">USER</span> <span class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-8764afe4-ca50-4c6b-8ceb-4519fc045f35"> <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-6c5fee9e-50a1-4e82-8cec-5c06be2d7aaa"> <div class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -120,7 +120,7 @@ Your system is all ready to go.
   <span class="s1">'user'</span><span class="p">,</span>
   <span class="o">&lt;</span><span class="no">USER</span> <span class="no">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-c9f5bff6-c898-45f6-ab1f-0ec3fd6ca056"> <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-61197684-19e5-4206-ae56-3792784c5600"> <div class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -145,7 +145,7 @@ Your system is all ready to go.
   <span class="o">.</span><span class="na">entityType</span><span class="o">(</span><span class="s">"user"</span><span class="o">)</span>
   <span class="o">.</span><span class="na">entityId</span><span class="o">(&lt;</span><span class="n">USER_ID</span><span class="o">&gt;);</span>
 <span class="n">client</span><span class="o">.</span><span class="na">createEvent</span><span class="o">(</span><span class="n">userEvent</span><span class="o">);</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a new item &quot;i0&quot; is created in your app on time <code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if eventTime is not specified), you can send a <code>$set</code> event for the item. Run the following <code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-c123e2b4-ec0c-4747-afe3-99970dd8d457">REST API</a></li> <li data-lang="python"><a href="#tab-687f83e3-f39a-44fa-a360-5a7e346f7df2">Python SDK</a></li> <li data-lang="php"><a href="#tab-9b08ae83-4061-4a67-a6ba-583868b277f9">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-234fbf42-8a23-488a-8a6a-154a498a2bf9">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-534577d4-b2be-41b1-8e9d-a7088ed5929f">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-c123e2b4-ec0c-4747-afe3-99970dd8d457"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td cla
 ss="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a new item &quot;i0&quot; is created in your app on time <code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if eventTime is not specified), you can send a <code>$set</code> event for the item. Run the following <code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-edc4d81a-2db0-4a4d-a5fe-1c58088624b2">REST API</a></li> <li data-lang="python"><a href="#tab-6f619515-acdd-4ee4-88de-8789b828d954">Python SDK</a></li> <li data-lang="php"><a href="#tab-c91ba414-f24f-4677-a461-41e17b474c7a">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-316c0bec-2f4c-49f9-9c8a-b714828ddc5e">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-4fb970eb-67d9-4939-8700-c1ecbdc9357b">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-edc4d81a-2db0-4a4d-a5fe-1c58088624b2"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td cla
 ss="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -160,7 +160,7 @@ Your system is all ready to go.
   "entityId" : "i0",
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-687f83e3-f39a-44fa-a360-5a7e346f7df2"> <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-6f619515-acdd-4ee4-88de-8789b828d954"> <div class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -173,7 +173,7 @@ Your system is all ready to go.
   <span class="n">entity_type</span><span class="o">=</span><span class="s">"item"</span><span class="p">,</span>
   <span class="n">entity_id</span><span class="o">=&lt;</span><span class="n">ITEM_ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-9b08ae83-4061-4a67-a6ba-583868b277f9"> <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-c91ba414-f24f-4677-a461-41e17b474c7a"> <div class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -190,7 +190,7 @@ Your system is all ready to go.
 <span class="p">));</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-234fbf42-8a23-488a-8a6a-154a498a2bf9"> <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-316c0bec-2f4c-49f9-9c8a-b714828ddc5e"> <div class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -203,7 +203,7 @@ Your system is all ready to go.
   <span class="o">&lt;</span><span class="no">ITEM</span> <span class="no">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-534577d4-b2be-41b1-8e9d-a7088ed5929f"> <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-4fb970eb-67d9-4939-8700-c1ecbdc9357b"> <div class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -214,7 +214,7 @@ Your system is all ready to go.
   <span class="o">.</span><span class="na">entityType</span><span class="o">(</span><span class="s">"item"</span><span class="o">)</span>
   <span class="o">.</span><span class="na">entityId</span><span class="o">(&lt;</span><span class="n">ITEM_ID</span><span class="o">&gt;);</span>
 <span class="n">client</span><span class="o">.</span><span class="na">createEvent</span><span class="o">(</span><span class="n">itemEvent</span><span class="o">)</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When the user &quot;u0&quot; view item &quot;i0&quot; on time <code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if eventTime is not specified), you can send a view event. Run the following <code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-c2ff15f5-714e-4235-9603-e912637e0ca4">REST API</a></li> <li data-lang="python"><a href="#tab-28a67892-4244-4124-9964-271897eabc92">Python SDK</a></li> <li data-lang="php"><a href="#tab-5c824856-ab08-47c2-9099-7713f336caaf">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-20bfad51-2935-47a2-bb14-63e6d6aac973">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-c08337e0-539f-4567-8121-eaf956e42bc3">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-c2ff15f5-714e-4235-9603-e912637e0ca4"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text
 -align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <p>When the user &quot;u0&quot; view item &quot;i0&quot; on time <code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if eventTime is not specified), you can send a view event. Run the following <code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-b2f6de76-4058-41e9-b6db-30d5b900f25f">REST API</a></li> <li data-lang="python"><a href="#tab-139a990a-3269-4a72-a2a7-9c83dab0658d">Python SDK</a></li> <li data-lang="php"><a href="#tab-143a1e87-3443-4e4a-9a16-4041886f4cd0">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-7faa37dc-3aaf-44fb-9677-0db6cc0a9808">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-ce687ae9-f404-4464-9c7b-fa07cb439159">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-b2f6de76-4058-41e9-b6db-30d5b900f25f"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text
 -align: right"><pre class="lineno">1
 2
 3
 4
@@ -233,7 +233,7 @@ Your system is all ready to go.
   "targetEntityId" : "i0",
   "eventTime" : "2014-11-10T12:34:56.123-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-28a67892-4244-4124-9964-271897eabc92"> <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-139a990a-3269-4a72-a2a7-9c83dab0658d"> <div class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -250,7 +250,7 @@ Your system is all ready to go.
   <span class="n">target_entity_type</span><span class="o">=</span><span class="s">"item"</span><span class="p">,</span>
   <span class="n">target_entity_id</span><span class="o">=&lt;</span><span class="n">ITEM</span> <span class="n">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-5c824856-ab08-47c2-9099-7713f336caaf"> <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-143a1e87-3443-4e4a-9a16-4041886f4cd0"> <div class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -269,7 +269,7 @@ Your system is all ready to go.
    <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> <span class="o">&lt;</span><span class="nx">ITEM</span> <span class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-20bfad51-2935-47a2-bb14-63e6d6aac973"> <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-7faa37dc-3aaf-44fb-9677-0db6cc0a9808"> <div class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -286,7 +286,7 @@ Your system is all ready to go.
     <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> <span class="o">&lt;</span><span class="no">ITEM</span> <span class="no">ID</span><span class="o">&gt;</span>
   <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-c08337e0-539f-4567-8121-eaf956e42bc3"> <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-ce687ae9-f404-4464-9c7b-fa07cb439159"> <div class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -344,14 +344,14 @@ User u10 views item i7
 </pre></td></tr></tbody></table> </div> <p>When the engine is deployed successfully and running, you should see a console message similar to the following:</p><div class="highlight shell"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2</pre></td><td class="code"><pre><span class="o">[</span>INFO] <span class="o">[</span>HttpListener] Bound to /0.0.0.0:8000
 <span class="o">[</span>INFO] <span class="o">[</span>MasterActor] Bind successful. Ready to serve.
-</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine process.</p><p>By default, the deployed engine binds to <a href="http://localhost:8000"><a href="http://localhost:8000">http://localhost:8000</a></a>. You can visit that page in your web browser to check its status.</p><p><img alt="Engine Status" src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' class='header-anchors'>6. Use the Engine</h2><p>Now, You can retrieve predicted results. To rank items with IDs &quot;i1&quot;, &quot;i3&quot;, &quot;i10&quot;, &quot;i2&quot;, &quot;i5&quot;, &quot;i31&quot;, &quot;i9&quot; for user &quot;u2&quot;. You send this JSON <code>{ &quot;user&quot;: &quot;u2&quot;, &quot;items&quot;: [&quot;i1&quot;, &quot;i3&quot;, &quot;i10&quot;, &quot;i2&quot;, &quot;i5&quot;, &quot;i31&quot;, &quot;i9&quot;] }</code> to the deployed engine and it will return a JSON of the ranked items. Simply send a query by making a HTTP request or through the <code>EngineCl
 ient</code> of an SDK.</p><p>With the deployed engine running, open another 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-e21bb54d-c52b-47d8-972f-1d5b92593ec0">REST API</a></li> <li data-lang="python"><a href="#tab-92d50e54-9aaa-4e72-8a18-d667572ac2e8">Python SDK</a></li> <li data-lang="php"><a href="#tab-7c13ef7b-8216-4f7d-b03d-65a1c5f2665b">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-e92ec963-5243-4026-a73c-fef3821dd823">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-c6ae3acd-18c6-4285-a4e6-773feec019c0">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-e21bb54d-c52b-47d8-972f-1d5b92593ec0"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine process.</p><p>By default, the deployed engine binds to <a href="http://localhost:8000"><a href="http://localhost:8000">http://localhost:8000</a></a>. You can visit that page in your web browser to check its status.</p><p><img alt="Engine Status" src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' class='header-anchors'>6. Use the Engine</h2><p>Now, You can retrieve predicted results. To rank items with IDs &quot;i1&quot;, &quot;i3&quot;, &quot;i10&quot;, &quot;i2&quot;, &quot;i5&quot;, &quot;i31&quot;, &quot;i9&quot; for user &quot;u2&quot;. You send this JSON <code>{ &quot;user&quot;: &quot;u2&quot;, &quot;items&quot;: [&quot;i1&quot;, &quot;i3&quot;, &quot;i10&quot;, &quot;i2&quot;, &quot;i5&quot;, &quot;i31&quot;, &quot;i9&quot;] }</code> to the deployed engine and it will return a JSON of the ranked items. Simply send a query by making a HTTP request or through the <code>EngineCl
 ient</code> of an SDK.</p><p>With the deployed engine running, open another 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-2426c8a7-b0bd-4ec1-9e9d-93fadca970a6">REST API</a></li> <li data-lang="python"><a href="#tab-ae7e0c2d-ffcd-480f-bbd9-9a92a87c9d1b">Python SDK</a></li> <li data-lang="php"><a href="#tab-7600643d-c044-40b8-af28-3e1223f41d24">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-e26dbd1d-1509-4aad-95a6-369834b62185">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-e6eb9cef-be5d-4270-9834-3536af7f2e47">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-2426c8a7-b0bd-4ec1-9e9d-93fadca970a6"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4</pre></td> <td class="code"><pre><span class="gp">$ </span>curl -H <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
 -d <span class="s1">'{ "user": "u2", "items": ["i1", "i3", "i10", "i2", "i5", "i31", "i9"]}'</span> <span class="se">\</span>
 http://localhost:8000/queries.json
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-92d50e54-9aaa-4e72-8a18-d667572ac2e8"> <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-ae7e0c2d-ffcd-480f-bbd9-9a92a87c9d1b"> <div class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -362,7 +362,7 @@ http://localhost:8000/queries.json
   <span class="s">"user"</span><span class="p">:</span> <span class="s">"u2"</span><span class="p">,</span>
   <span class="s">"items"</span><span class="p">:</span> <span class="p">[</span><span class="s">"i1"</span><span class="p">,</span> <span class="s">"i3"</span><span class="p">,</span> <span class="s">"i10"</span><span class="p">,</span> <span class="s">"i2"</span><span class="p">,</span> <span class="s">"i5"</span><span class="p">,</span> <span class="s">"i31"</span><span class="p">,</span> <span class="s">"i9"</span><span class="p">]</span>
 <span class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-7c13ef7b-8216-4f7d-b03d-65a1c5f2665b"> <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-7600643d-c044-40b8-af28-3e1223f41d24"> <div class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -385,7 +385,7 @@ http://localhost:8000/queries.json
 <span class="nb">print_r</span><span class="p">(</span><span class="nv">$response</span><span class="p">);</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-e92ec963-5243-4026-a73c-fef3821dd823"> <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-e26dbd1d-1509-4aad-95a6-369834b62185"> <div class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -402,7 +402,7 @@ http://localhost:8000/queries.json
   <span class="s1">'items'</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="s1">'i1'</span><span class="p">,</span> <span class="s1">'i3'</span><span class="p">,</span> <span class="s1">'i10'</span><span class="p">,</span> <span class="s1">'i2'</span><span class="p">,</span> <span class="s1">'i5'</span><span class="p">,</span> <span class="s1">'i31'</span><span class="p">,</span> <span class="s1">'i9'</span><span class="p">])</span>
 
 <span class="nb">puts</span> <span class="n">response</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-c6ae3acd-18c6-4285-a4e6-773feec019c0"> <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-e6eb9cef-be5d-4270-9834-3536af7f2e47"> <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/c17b9607/templates/recommendation/batch-evaluator/index.html
----------------------------------------------------------------------
diff --git a/templates/recommendation/batch-evaluator/index.html b/templates/recommendation/batch-evaluator/index.html
index 392eb7a..d6888ca 100644
--- a/templates/recommendation/batch-evaluator/index.html
+++ b/templates/recommendation/batch-evaluator/index.html
@@ -59,7 +59,7 @@
     <span class="nc">Seq</span><span class="o">(</span><span class="n">evalDataSet</span><span class="o">)</span>
   <span class="o">}</span>
 
-</pre></td></tr></tbody></table> </div> <div class="alert-message note"><p>Alternatively, you can create a new DataSource extending original DataSource. Then you can add the new one in Engine.scala and specify which one to use in engine.json.</p></div> <h2 id='2.-add-a-new-evaluator' class='header-anchors'>2. Add a new Evaluator</h2><p>Create a new file <code>BatchPersistableEvaluator.scala</code>. Unlike the <code>MetricEvaluator</code>, this Evaluator simply writes the Query and correpsonding PredictedResult to the output directory without performaning any metrics calculation.</p><p>Note that output directory is specified by the variable <code>outputDir</code>.</p><div class="highlight scala"><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 class="alert-message note"><p>Alternatively, you can create a new DataSource extending original DataSource. Then you can add the new one in Engine.scala and specify which one to use in engine.json.</p></div> <h2 id='2.-add-a-new-evaluator' class='header-anchors'>2. Add a new Evaluator</h2><p>Create a new file <code>BatchPersistableEvaluator.scala</code>. Unlike the <code>MetricEvaluator</code>, this Evaluator simply writes the Query and corresponding PredictedResult to the output directory without performing any metrics calculation.</p><p>Note that output directory is specified by the variable <code>outputDir</code>.</p><div class="highlight scala"><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/c17b9607/templates/recommendation/evaluation/index.html
----------------------------------------------------------------------
diff --git a/templates/recommendation/evaluation/index.html b/templates/recommendation/evaluation/index.html
index 933407a..3cd1dc2 100644
--- a/templates/recommendation/evaluation/index.html
+++ b/templates/recommendation/evaluation/index.html
@@ -111,7 +111,7 @@ Metrics:
   PositiveCount <span class="o">(</span><span class="nv">threshold</span><span class="o">=</span>1.0<span class="o">)</span>: 10.006666666666666
 <span class="o">[</span>INFO 2015-03-31 00:36:01,516] <span class="o">[</span>CoreWorkflow<span class="nv">$]</span> runEvaluation completed
 
-</pre></td></tr></tbody></table> </div> <p>The console prints out the evaluation meric score of each engine params, and finally pretty print the optimal engine params. Amongs the 3 engine params we evaluate, the best Prediction@k has a score of ~0.1521.</p><h2 id='the-evaluation-design' class='header-anchors'>The Evaluation Design</h2><p>We assume you have read the <a href="/evaluation">Tuning and Evaluation</a> section. We will cover the evaluation aspects which are specific to the recommendation engine.</p><p>In recommendation evaluation, the raw data is a sequence of known ratings. A rating has 3 components: user, item, and a score. We use the $k-fold$ method for evaluation, the raw data is sliced into a sequence of (training, validation) data tuple.</p><p>In the validation data, we construct a query for <em>each user</em>, and get a list of recommended items from the engine. It is vastly different from the classification tutorial, where there is a one-to-one corresponding betwee
 n the training data point and the validation data point. In this evaluation, our unit of evaluation is <em>user</em>, we evaluate the quality of an engine using the known rating of a user.</p><h3 id='key-assumptions' class='header-anchors'>Key assumptions</h3><p>There are multiple assumptions we have to make when we evaluate a recommendation engine:</p> <ul> <li><p>Definition of &#39;good&#39;. We want to quantify if the engine is able to recommend items which the user likes, we need to define what is meant by &#39;good&#39;. In this examle, we have two kinds of events: &#39;rate&#39; and &#39;buy&#39;. The &#39;rate&#39; event is associated with a rating value which ranges between 1 to 4, and the &#39;buy&#39; event is mapped to a rating of 4. When we implement the metric, we have to specify a rating threshold, only the rating above the threshold is considered &#39;good&#39;.</p></li> <li><p>The absense of complete rating. It is extremely unlikely that the training data contains ra
 ting for all user-item tuples. In contrast, of a system containing 1000 items, a user may only have rated 20 of them, leaving 980 items unrated. There is no way for us to certainly tell if the user likes an unrated product. When we examine the evaluation result, it is important for us to keep in mind that the final metric is only an approximation of the actual result.</p></li> <li><p>Recommendation affects user behavior. Suppose you are a e-commerce company and would like to use the recommendation engine to personalize the landing page, the item you show in the langing page directly impacts what the user is going to purchase. This is different from weather prediction, whatever the weather forecast engine predicts, tomorrow&#39;s weather won&#39;t be affected. Therefore, when we conduct offline evaluation for recommendation engines, it is possible that the final user behavior is dramatically different from the evaluation result. However, in the evaluation, for simplicity, we have to 
 assume that user behavior is homogenous.</p></li> </ul> <h2 id='evaluation-data-generation' class='header-anchors'>Evaluation Data Generation</h2><h3 id='actual-result' class='header-anchors'>Actual Result</h3><p>In MyRecommendation/src/main/scala/<strong><em>Engine.scala</em></strong>, we define the <code>ActualResult</code> which represents the user rating for validation. It stores the list of ratings in the validation set for a user.</p><div class="highlight scala"><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>The console prints out the evaluation meric score of each engine params, and finally pretty print the optimal engine params. Amongs the 3 engine params we evaluate, the best Prediction@k has a score of ~0.1521.</p><h2 id='the-evaluation-design' class='header-anchors'>The Evaluation Design</h2><p>We assume you have read the <a href="/evaluation">Tuning and Evaluation</a> section. We will cover the evaluation aspects which are specific to the recommendation engine.</p><p>In recommendation evaluation, the raw data is a sequence of known ratings. A rating has 3 components: user, item, and a score. We use the $k-fold$ method for evaluation, the raw data is sliced into a sequence of (training, validation) data tuple.</p><p>In the validation data, we construct a query for <em>each user</em>, and get a list of recommended items from the engine. It is vastly different from the classification tutorial, where there is a one-to-one corresponding betwee
 n the training data point and the validation data point. In this evaluation, our unit of evaluation is <em>user</em>, we evaluate the quality of an engine using the known rating of a user.</p><h3 id='key-assumptions' class='header-anchors'>Key assumptions</h3><p>There are multiple assumptions we have to make when we evaluate a recommendation engine:</p> <ul> <li><p>Definition of &#39;good&#39;. We want to quantify if the engine is able to recommend items which the user likes, we need to define what is meant by &#39;good&#39;. In this examle, we have two kinds of events: &#39;rate&#39; and &#39;buy&#39;. The &#39;rate&#39; event is associated with a rating value which ranges between 1 to 4, and the &#39;buy&#39; event is mapped to a rating of 4. When we implement the metric, we have to specify a rating threshold, only the rating above the threshold is considered &#39;good&#39;.</p></li> <li><p>The absence of complete rating. It is extremely unlikely that the training data contains ra
 ting for all user-item tuples. In contrast, of a system containing 1000 items, a user may only have rated 20 of them, leaving 980 items unrated. There is no way for us to certainly tell if the user likes an unrated product. When we examine the evaluation result, it is important for us to keep in mind that the final metric is only an approximation of the actual result.</p></li> <li><p>Recommendation affects user behavior. Suppose you are a e-commerce company and would like to use the recommendation engine to personalize the landing page, the item you show in the langing page directly impacts what the user is going to purchase. This is different from weather prediction, whatever the weather forecast engine predicts, tomorrow&#39;s weather won&#39;t be affected. Therefore, when we conduct offline evaluation for recommendation engines, it is possible that the final user behavior is dramatically different from the evaluation result. However, in the evaluation, for simplicity, we have to 
 assume that user behavior is homogenous.</p></li> </ul> <h2 id='evaluation-data-generation' class='header-anchors'>Evaluation Data Generation</h2><h3 id='actual-result' class='header-anchors'>Actual Result</h3><p>In MyRecommendation/src/main/scala/<strong><em>Engine.scala</em></strong>, we define the <code>ActualResult</code> which represents the user rating for validation. It stores the list of ratings in the validation set for a user.</p><div class="highlight scala"><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="k">case</span> <span class="k">class</span> <span class="nc">ActualResult</span><span class="o">(</span>
   <span class="n">ratings</span><span class="k">:</span> <span class="kt">Array</span><span class="o">[</span><span class="kt">Rating</span><span class="o">]</span>



[09/11] predictionio-site git commit: Documentation based on apache/predictionio#54415e1066ae2d646eef62ebfdf801ace1de2097

Posted by gi...@apache.org.
http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/gallery/template-gallery/index.html
----------------------------------------------------------------------
diff --git a/gallery/template-gallery/index.html b/gallery/template-gallery/index.html
index c6b5c50..77f3929 100644
--- a/gallery/template-gallery/index.html
+++ b/gallery/template-gallery/index.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><title>Engine Template Gallery</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Engine Template Gallery"/><link rel="canonical" href="https://predictionio.apache.org/gallery/template-gallery/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><script src="//cdn.mathjax.org/math
 jax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="search-bar-row-wrapper"><div class="container-fluid" id="search-bar-row"><div class="row"><div class="col-md-9 col-sm-11 col-xs-11"><div 
 class="hidden-md hidden-lg" id="mobile-page-heading-wrapper"><p>PredictionIO Docs</p><h4>Browse</h4></div><h4 class="hidden-sm hidden-xs">PredictionIO Docs</h4></div><div class="col-md-3 col-sm-1 col-xs-1 hidden-md hidden-lg"><img id="left-menu-indicator" src="/images/icons/down-arrow-dfe9f7fe.png"/></div><div class="col-md-3 col-sm-12 col-xs-12 swiftype-wrapper"><div class="swiftype"><form class="search-form"><img class="search-box-toggler hidden-xs hidden-sm" src="/images/icons/search-glass-704bd4ff.png"/><div class="search-box"><img src="/images/icons/search-glass-704bd4ff.png"/><input type="text" id="st-search-input" class="st-search-input" placeholder="Search Doc..."/></div><img class="swiftype-row-hider hidden-md hidden-lg" src="/images/icons/drawer-toggle-active-fcbef12a.png"/></form></div></div><div class="mobile-left-menu-toggler hidden-md hidden-lg"></div></div></div></div><div id="page" class="container-fluid"><div class="row"><div id="left-menu-wrapper" class="col-md-3">
 <nav id="nav-main"><ul><li class="level-1"><a class="expandible" href="/"><span>Apache PredictionIO® Documentation</span></a><ul><li class="level-2"><a class="final" href="/"><span>Welcome to Apache PredictionIO®</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Started</span></a><ul><li class="level-2"><a class="final" href="/start/"><span>A Quick Intro</span></a></li><li class="level-2"><a class="final" href="/install/"><span>Installing Apache PredictionIO</span></a></li><li class="level-2"><a class="final" href="/start/download/"><span>Downloading an Engine Template</span></a></li><li class="level-2"><a class="final" href="/start/deploy/"><span>Deploying Your First Engine</span></a></li><li class="level-2"><a class="final" href="/start/customize/"><span>Customizing the Engine</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Integrating with Your App</span></a><ul><li class="level-2"><a class="final" href="
 /appintegration/"><span>App Integration Overview</span></a></li><li class="level-2"><a class="expandible" href="/sdk/"><span>List of SDKs</span></a><ul><li class="level-3"><a class="final" href="/sdk/java/"><span>Java & Android SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/php/"><span>PHP SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/python/"><span>Python SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/ruby/"><span>Ruby SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/community/"><span>Community Powered SDKs</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Deploying an Engine</span></a><ul><li class="level-2"><a class="final" href="/deploy/"><span>Deploying as a Web Service</span></a></li><li class="level-2"><a class="final" href="/batchpredict/"><span>Batch Predictions</span></a></li><li class="level-2"><a class="final" href="/deploy/monitoring/"><span>Monitorin
 g Engine</span></a></li><li class="level-2"><a class="final" href="/deploy/engineparams/"><span>Setting Engine Parameters</span></a></li><li class="level-2"><a class="final" href="/deploy/enginevariants/"><span>Deploying Multiple Engine Variants</span></a></li><li class="level-2"><a class="final" href="/deploy/plugin/"><span>Engine Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Customizing an Engine</span></a><ul><li class="level-2"><a class="final" href="/customize/"><span>Learning DASE</span></a></li><li class="level-2"><a class="final" href="/customize/dase/"><span>Implement DASE</span></a></li><li class="level-2"><a class="final" href="/customize/troubleshooting/"><span>Troubleshooting Engine Development</span></a></li><li class="level-2"><a class="final" href="/api/current/#package"><span>Engine Scala APIs</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Collecting and Analyzing Data</span></a><ul
 ><li class="level-2"><a class="final" href="/datacollection/"><span>Event Server Overview</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventapi/"><span>Collecting Data with REST/SDKs</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventmodel/"><span>Events Modeling</span></a></li><li class="level-2"><a class="final" href="/datacollection/webhooks/"><span>Unifying Multichannel Data with Webhooks</span></a></li><li class="level-2"><a class="final" href="/datacollection/channel/"><span>Channel</span></a></li><li class="level-2"><a class="final" href="/datacollection/batchimport/"><span>Importing Data in Batch</span></a></li><li class="level-2"><a class="final" href="/datacollection/analytics/"><span>Using Analytics Tools</span></a></li><li class="level-2"><a class="final" href="/datacollection/plugin/"><span>Event Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Choosing an Algorithm(s
 )</span></a><ul><li class="level-2"><a class="final" href="/algorithm/"><span>Built-in Algorithm Libraries</span></a></li><li class="level-2"><a class="final" href="/algorithm/switch/"><span>Switching to Another Algorithm</span></a></li><li class="level-2"><a class="final" href="/algorithm/multiple/"><span>Combining Multiple Algorithms</span></a></li><li class="level-2"><a class="final" href="/algorithm/custom/"><span>Adding Your Own Algorithms</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>ML Tuning and Evaluation</span></a><ul><li class="level-2"><a class="final" href="/evaluation/"><span>Overview</span></a></li><li class="level-2"><a class="final" href="/evaluation/paramtuning/"><span>Hyperparameter Tuning</span></a></li><li class="level-2"><a class="final" href="/evaluation/evaluationdashboard/"><span>Evaluation Dashboard</span></a></li><li class="level-2"><a class="final" href="/evaluation/metricchoose/"><span>Choosing Evaluation Metrics</span
 ></a></li><li class="level-2"><a class="final" href="/evaluation/metricbuild/"><span>Building Evaluation Metrics</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>System Architecture</span></a><ul><li class="level-2"><a class="final" href="/system/"><span>Architecture Overview</span></a></li><li class="level-2"><a class="final" href="/system/anotherdatastore/"><span>Using Another Data Store</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>PredictionIO® Official Templates</span></a><ul><li class="level-2"><a class="final" href="/templates/"><span>Intro</span></a></li><li class="level-2"><a class="expandible" href="#"><span>Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/recommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/r
 ecommendation/evaluation/"><span>Evaluation Explained</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/reading-custom-events/"><span>Read Custom Events</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-data-prep/"><span>Customize Data Preparator</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-serving/"><span>Customize Serving</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/training-with-implicit-preference/"><span>Train with Implicit Preference</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/blacklist-items/"><span>Filter Recommended Items by Blacklist in Query</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/batch-evaluator/"><span>Batch Persistable 
 Evaluator</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>E-Commerce Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/adjust-score/"><span>Adjust Score</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Similar Product</span></a><ul><li class="level-3"><a class="final" href="/templates/similarproduct/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="f
 inal" href="/templates/similarproduct/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/multi-events-multi-algos/"><span>Multiple Events and Multiple Algorithms</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/return-item-properties/"><span>Returns Item Properties</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/rid-user-set-event/"><span>Get Rid of Events for Users</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/recommended-user/"><span>Recommend Users</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Classification</span></a><ul><li class="level-3"><a class
 ="final" href="/templates/classification/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/classification/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/classification/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/classification/add-algorithm/"><span>Use Alternative Algorithm</span></a></li><li class="level-3"><a class="final" href="/templates/classification/reading-custom-properties/"><span>Read Custom Properties</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Engine Template Gallery</span></a><ul><li class="level-2"><a class="final active" href="/gallery/template-gallery/"><span>Browse</span></a></li><li class="level-2"><a class="final" href="/community/submit-template/"><span>Submit your Engine as a Template</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Demo Tutorials<
 /span></a><ul><li class="level-2"><a class="final" href="/demo/tapster/"><span>Comics Recommendation Demo</span></a></li><li class="level-2"><a class="final" href="/demo/community/"><span>Community Contributed Demo</span></a></li><li class="level-2"><a class="final" href="/demo/textclassification/"><span>Text Classification Engine Tutorial</span></a></li></ul></li><li class="level-1"><a class="expandible" href="/community/"><span>Getting Involved</span></a><ul><li class="level-2"><a class="final" href="/community/contribute-code/"><span>Contribute Code</span></a></li><li class="level-2"><a class="final" href="/community/contribute-documentation/"><span>Contribute Documentation</span></a></li><li class="level-2"><a class="final" href="/community/contribute-sdk/"><span>Contribute a SDK</span></a></li><li class="level-2"><a class="final" href="/community/contribute-webhook/"><span>Contribute a Webhook</span></a></li><li class="level-2"><a class="final" href="/community/projects/"><span
 >Community Projects</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Help</span></a><ul><li class="level-2"><a class="final" href="/resources/faq/"><span>FAQs</span></a></li><li class="level-2"><a class="final" href="/support/"><span>Support</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Resources</span></a><ul><li class="level-2"><a class="final" href="/cli/"><span>Command-line Interface</span></a></li><li class="level-2"><a class="final" href="/resources/release/"><span>Release Cadence</span></a></li><li class="level-2"><a class="final" href="/resources/intellij/"><span>Developing Engines with IntelliJ IDEA</span></a></li><li class="level-2"><a class="final" href="/resources/upgrade/"><span>Upgrade Instructions</span></a></li><li class="level-2"><a class="final" href="/resources/glossary/"><span>Glossary</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Apache Software Found
 ation</span></a><ul><li class="level-2"><a class="final" href="https://www.apache.org/"><span>Apache Homepage</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/licenses/"><span>License</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/sponsorship.html"><span>Sponsorship</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/foundation/thanks.html"><span>Thanks</span></a></li><li class="level-2"><a class="final" href="https://www.apache.org/security/"><span>Security</span></a></li></ul></li></ul></nav></div><div class="col-md-9 col-sm-12"><div class="content-header hidden-md hidden-lg"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">Engine Template Gallery</a><span class="spacer">&gt;</span></li><li><span class="last">Browse</span></li></ul></div><div id="page-title"><h1>Engine Template Gallery</h1></div></div><div id="table-of-content-wrapper"><a id="edit-page-lin
 k" href="https://github.com/apache/predictionio/tree/livedoc/docs/manual/source/gallery/template-gallery.html.md"><img src="/images/icons/edit-pencil-d6c1bb3d.png"/>Edit this page</a></div><div class="content-header hidden-sm hidden-xs"><div id="breadcrumbs" class="hidden-sm hidden xs"><ul><li><a href="#">Engine Template Gallery</a><span class="spacer">&gt;</span></li><li><span class="last">Browse</span></li></ul></div><div id="page-title"><h1>Engine Template Gallery</h1></div></div><div class="content"><p>Pick a tab for the type of template you are looking for. Some still need to be ported (a simple process) to Apache PIO and these are marked. Also see each Template description for special support instructions.</p><div class="tabs"> <ul class="control"> <li data-lang=""><a href="#tab-929ae93d-69fc-46f2-a713-a6d92badb24c">Recommenders</a></li> <li data-lang=""><a href="#tab-486f74f6-1eb8-40c1-a16d-d5fc5207fee9">Classification</a></li> <li data-lang=""><a href="#tab-4a55b018-5fb4-480
 2-b6b5-20ed3539a0fd">Regression</a></li> <li data-lang=""><a href="#tab-89e56441-0198-4fd7-a4bd-9b6cb937b54f">NLP</a></li> <li data-lang=""><a href="#tab-3598e24d-ad55-47d4-beca-27b22e978ef8">Clustering</a></li> <li data-lang=""><a href="#tab-1af5e6b8-4385-43ca-93c6-f5b847615b8f">Similarity</a></li> <li data-lang=""><a href="#tab-92bc728a-a951-4232-8401-9cf98b2fa5dd">Other</a></li> </ul> <div data-tab="Recommenders" id="tab-929ae93d-69fc-46f2-a713-a6d92badb24c"> <h3><a href="https://github.com/actionml/universal-recommender">The Universal Recommender</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=actionml&amp;repo=universal-recommender&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Use for: </p> <ul class="tab-list"> <li class="tab-list-element">Personalized recommendations—user-based</li> <li class="tab-list-element">Similar items—item-based</li> <li class="tab-list-element">Viewed this bought 
 that—item-based cross-action</li> <li class="tab-list-element">Popular Items and User-defined ranking</li> <li class="tab-list-element">Item-set recommendations for complimentarty purchases or shopping carts—item-set-based</li> <li class="tab-list-element">Hybrid collaborative filtering and content based recommendations—limited content-based</li> <li class-tab-list-element>Business rules</li> </ul> <p>The name "Universal" refers to the use of this template in virtually any case that calls for recommendations - ecommerce, news, videos, virtually anywhere user behavioral data is known. This recommender uses the new <a href="http://mahout.apache.org/users/algorithms/intro-cooccurrence-spark.html">Cross-Occurrence (CCO) algorithm</a> to auto-correlate different user actions (clickstream data), profile data, contextual information (location, device), and some content types to make better recommendations. It also implements flexible filters and boosts for implementing business rules
 .</p> <p>Support: <a href="https://groups.google.com/forum/#!forum/actionml-user">The Universal Recommender user group</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.10.0-incubating</td> <td>already compatible</td> </tr> </table> <br> <h3><a href="https://github.com/apache/predictionio-template-recommender">Recommendation</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=apache&amp;repo=predictionio-template-recommender&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> An engine template is an almost-complete implementation of an engine. PredictionIO's Recommendation Engine Template has integrated Apache Spark MLlib's Collaborative Filtering algorithm by default. You can customize it easily to fit your spec
 ific needs. </p> <p>Support: <a href="http://predictionio.apache.org/support/">Apache PredictionIO mailing lists</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.10.0-incubating</td> <td>already compatible</td> </tr> </table> <br> <h3><a href="https://github.com/apache/predictionio-template-ecom-recommender">E-Commerce Recommendation</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=apache&amp;repo=predictionio-template-ecom-recommender&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This engine template provides personalized recommendation for e-commerce applications with the following features by default: </p> <ul class="tab-list"> <li class="tab-list-element">Exclude out-of-stock items</li> <li class="ta
 b-list-element">Provide recommendation to new users who sign up after the model is trained</li> <li class="tab-list-element">Recommend unseen items only (configurable)</li> <li class="tab-list-element">Recommend popular items if no information about the user is available (added in template version v0.4.0)</li> </ul> <p>Support: <a href="http://predictionio.apache.org/support/">Apache PredictionIO mailing lists</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.10.0-incubating</td> <td>already compatible</td> </tr> </table> <br> <h3><a href="https://github.com/apache/predictionio-template-similar-product">Similar Product</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=apache&amp;repo=predictionio-template-similar-product&amp;type=star&amp;count=true" frameborder="0" align="mid
 dle" scrolling="0" width="170px" height="20px"></iframe> <p> This engine template recommends products that are "similar" to the input product(s). Similarity is not defined by user or item attributes but by users' previous actions. By default, it uses 'view' action such that product A and B are considered similar if most users who view A also view B. The template can be customized to support other action types such as buy, rate, like..etc </p> <p>Support: <a href="http://predictionio.apache.org/support/">Apache PredictionIO mailing lists</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.10.0-incubating</td> <td>already compatible</td> </tr> </table> <br> <h3><a href="https://github.com/apache/predictionio-template-java-ecom-recommender">E-Commerce Recommendation (Java)</a></h3> <iframe sr
 c="https://ghbtns.com/github-btn.html?user=apache&amp;repo=predictionio-template-java-ecom-recommender&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This engine template provides personalized recommendation for e-commerce applications with the following features by default: </p> <ul class="tab-list"> <li class="tab-list-element">Exclude out-of-stock items</li> <li class="tab-list-element">Provide recommendation to new users who sign up after the model is trained</li> <li class="tab-list-element">Recommend unseen items only (configurable)</li> <li class="tab-list-element">Recommend popular items if no information about the user is available</li> </ul> <p>Support: <a href="http://predictionio.apache.org/support/">Apache PredictionIO mailing lists</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>P
 arallel</td> <td>Java</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.3</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/PredictionIO/template-scala-parallel-productranking">Product Ranking</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=PredictionIO&amp;repo=template-scala-parallel-productranking&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This engine template sorts a list of products for a user based on his/her preference. This is ideal for personalizing the display order of product page, catalog, or menu items if you have large number of options. It creates engagement and early conversion by placing products that a user prefers on the top. </p> <p>Support: </p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <
 td>Apache Licence 2.0</td> <td>stable</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/PredictionIO/template-scala-parallel-complementarypurchase">Complementary Purchase</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=PredictionIO&amp;repo=template-scala-parallel-complementarypurchase&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This engine template recommends the complementary items which most user frequently buy at the same time with one or more items in the query. </p> <p>Support: </p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/vaibhavist/template-scala-parallel-
 recommendation">Music Recommendations</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=vaibhavist&amp;repo=template-scala-parallel-recommendation&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This is very similar to music recommendations template. It is integrated with all the events a music application can have such as song played, liked, downloaded, purchased, etc. </p> <p>Support: <a href="https://github.com/vaibhavist/template-scala-parallel-recommendation/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/vngrs/template-scala-parallel-viewedthenbought">Viewed This Bought That</a></h3> <iframe
  src="https://ghbtns.com/github-btn.html?user=vngrs&amp;repo=template-scala-parallel-viewedthenbought&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This Engine uses co-occurence algorithm to match viewed items to bought items. Using this engine you may predict which item the user will buy, given the item(s) browsed. </p> <p>Support: <a href="https://github.com/vngrs/template-scala-parallel-viewedthenbought/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/goliasz/pio-template-fpm">Frequent Pattern Mining</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=goliasz&amp;repo=pio-template-fpm&amp;type=
 star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Template uses FP Growth algorithm allowing to mine for frequent patterns. Template returns subsequent items together with confidence score. Sometimes used as a shopping cart recommender but has other uses. </p> <p>Support: <a href="https://github.com/goliasz/pio-template-fpm/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.5</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/ramaboo/template-scala-parallel-similarproduct-with-rating">Similar Product with Rating</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=ramaboo&amp;repo=template-scala-parallel-similarproduct-with-rating&amp;type=star&amp;count=true" frame
 border="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Similar product template with rating support! Used for the MovieLens Demo. </p> <p>Support: <a href="https://github.com/ramaboo/template-scala-parallel-similarproduct-with-rating/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>beta</td> <td>0.9.0</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/goliasz/pio-template-fpm">Frequent Pattern Mining</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=goliasz&amp;repo=pio-template-fpm&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Template uses FP Growth algorithm allowing to mine for frequent patterns. Template returns subsequent items togeth
 er with confidence score. </p> <p>Support: <a href="https://github.com/goliasz/pio-template-fpm/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.5</td> <td>requires conversion</td> </tr> </table> <br> </div> <div data-tab="Classification" id="tab-486f74f6-1eb8-40c1-a16d-d5fc5207fee9"> <h3><a href="https://github.com/apache/predictionio-template-attribute-based-classifier">Classification</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=apache&amp;repo=predictionio-template-attribute-based-classifier&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> An engine template is an almost-complete implementation of an engine. PredictionIO's Classification Engine Template has integrated Apache Sp
 ark MLlib's Naive Bayes algorithm by default. </p> <p>Support: <a href="http://predictionio.apache.org/support/">Apache PredictionIO mailing lists</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.9.2</td> <td>already compatible</td> </tr> </table> <br> <h3><a href="https://github.com/haricharan123/PredictionIo-lingpipe-MultiLabelClassification">Classification</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=haricharan123&amp;repo=PredictionIo-lingpipe-MultiLabelClassification&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This engine template is an almost-complete implementation of an engine meant to used with PredictionIO. This Multi-label Classification Engine Template has integrated LingPipe (http://al
 ias-i.com/lingpipe/) algorithm by default. </p> <p>Support: </p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Java</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.9.5</td> <td>already compatible</td> </tr> </table> <br> <h3><a href="https://github.com/PredictionIO/template-scala-parallel-leadscoring">Lead Scoring</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=PredictionIO&amp;repo=template-scala-parallel-leadscoring&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This engine template predicts the probability of an user will convert (conversion event by user) in the current session. </p> <p>Support: </p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <t
 d>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/apache/predictionio-template-text-classifier">Text Classification</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=apache&amp;repo=predictionio-template-text-classifier&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Use this engine for general text classification purposes. Uses OpenNLP library for text vectorization, includes t.f.-i.d.f.-based feature transformation and reduction, and uses Spark MLLib's Multinomial Naive Bayes implementation for classification. </p> <p>Support: <a href="https://github.com/apache/predictionio-template-text-classifier/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> 
 <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/andrewwuan/PredictionIO-Churn-Prediction-H2O-Sparkling-Water">Churn Prediction - H2O Sparkling Water</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=andrewwuan&amp;repo=PredictionIO-Churn-Prediction-H2O-Sparkling-Water&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This is an engine template with Sparkling Water integration. The goal is to use Deep Learning algorithm to predict the churn rate for a phone carrier's customers. </p> <p>Support: <a href="https://github.com/andrewwuan/PredictionIO-Churn-Prediction-H2O-Sparkling-Water/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> 
 <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/detrevid/predictionio-template-classification-dl4j">Classification Deeplearning4j</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=detrevid&amp;repo=predictionio-template-classification-dl4j&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> A classification engine template that uses Deeplearning4j library. </p> <p>Support: <a href="https://github.com/detrevid/predictionio-template-classification-dl4j/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com
 /EmergentOrder/template-scala-probabilistic-classifier-batch-lbfgs">Probabilistic Classifier (Logistic Regression w/ LBFGS)</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=EmergentOrder&amp;repo=template-scala-probabilistic-classifier-batch-lbfgs&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> A PredictionIO engine template using logistic regression (trained with limited-memory BFGS ) with raw (probabilistic) outputs. </p> <p>Support: <a href="https://github.com/EmergentOrder/template-scala-probabilistic-classifier-batch-lbfgs/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>MIT License</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/chrischris292/template-class
 ification-opennlp">Document Classification with OpenNLP</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=chrischris292&amp;repo=template-classification-opennlp&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Document Classification template with OpenNLP GISModel. </p> <p>Support: <a href="https://github.com/chrischris292/template-classification-opennlp/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.0</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/harry5z/template-circuit-classification-sparkling-water">Circuit End Use Classification</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=harry5z&amp;repo=template-circuit-classification-s
 parkling-water&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> A classification engine template that uses machine learning models trained with sample circuit energy consumption data and end usage to predict the end use of a circuit by its energy consumption history. </p> <p>Support: <a href="https://github.com/harry5z/template-circuit-classification-sparkling-water/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.1</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/ailurus1991/GBRT_Template_PredictionIO">GBRT_Classification</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=ailurus1991&amp;repo=GBRT_Template_PredictionIO&amp;type=star&amp;count=true" 
 frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> The Gradient-Boosted Regression Trees(GBRT) for classification. </p> <p>Support: <a href="https://github.com/ailurus1991/GBRT_Template_PredictionIO/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/mohanaprasad1994/PredictionIO-MLlib-Decision-Trees-Template">MLlib-Decision-Trees-Template</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=mohanaprasad1994&amp;repo=PredictionIO-MLlib-Decision-Trees-Template&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> An engine template is an almost-complete implementation of an e
 ngine. This is a classification engine template which has integrated Apache Spark MLlib's Decision tree algorithm by default. </p> <p>Support: <a href="https://github.com/mohanaprasad1994/PredictionIO-MLlib-Decision-Trees-Template/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.0</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/jimmyywu/predictionio-template-classification-dl4j-multilayer-network">Classification with MultiLayerNetwork</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=jimmyywu&amp;repo=predictionio-template-classification-dl4j-multilayer-network&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This engine template integrates the Mul
 tiLayerNetwork implementation from the Deeplearning4j library into PredictionIO. In this template, we use PredictionIO to classify the widely-known IRIS flower dataset by constructing a deep-belief net. </p> <p>Support: <a href="https://github.com/jimmyywu/predictionio-template-classification-dl4j-multilayer-network/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.0</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/thomasste/template-scala-parallel-dl4j-rntn">Deeplearning4j RNTN</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=thomasste&amp;repo=template-scala-parallel-dl4j-rntn&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Recursive Neural Tenso
 r Network algorithm is supervised learning algorithm used to predict sentiment of sentences. This template is based on deeplearning4j RNTN example: https://github.com/SkymindIO/deeplearning4j-nlp-examples/tree/master/src/main/java/org/deeplearning4j/rottentomatoes/rntn. It's goal is to show how to integrate deeplearning4j library with PredictionIO. </p> <p>Support: <a href="https://github.com/thomasste/template-scala-parallel-dl4j-rntn/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/singsanj/classifier-kafka-streaming-template">classifier-kafka-streaming-template</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=singsanj&amp;repo=classifier-kafka-streaming-template
 &amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> The template will provide a simple integration of DASE with kafka using spark streaming capabilites in order to play around with real time notification, messages .. </p> <p>Support: <a href="https://github.com/singsanj/classifier-kafka-streaming-template/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>-</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/peoplehum/BagOfWords_SentimentAnalysis_Template">Sentiment Analysis - Bag of Words Model</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=peoplehum&amp;repo=BagOfWords_SentimentAnalysis_Template&amp;type=star&amp;count=true" frameborder="0" align="middle"
  scrolling="0" width="170px" height="20px"></iframe> <p> This sentiment analysis template uses a bag of words model. Given text, the engine will return sentiment as 1.0 (positive) or 0.0 (negative) along with scores indicating how +ve or -ve it is. </p> <p>Support: <a href="https://github.com/peoplehum/BagOfWords_SentimentAnalysis_Template/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.10.0-incubating</td> <td>already compatible</td> </tr> </table> <br> <h3><a href="https://github.com/jpioug/predictionio-template-iris">Classification template for Iris</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=jpioug&amp;repo=predictionio-template-iris&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></ifram
 e> <p> This is Python(PySpark) based classification example for Iris dataset. </p> <p>Support: </p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Python</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.12.0-incubating</td> <td></td> </tr> </table> <br> </div> <div data-tab="Regression" id="tab-4a55b018-5fb4-4802-b6b5-20ed3539a0fd"> <h3><a href="https://github.com/goliasz/pio-template-sr">Survival Regression</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=goliasz&amp;repo=pio-template-sr&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Survival regression template is based on brand new Spark 1.6 AFT (accelerated failure time) survival analysis algorithm. There are interesting applications of survival analysis like: </p> <ul class="tab-list"> <li class="tab-list-elem
 ent">Business Planning : Profiling customers who has a higher survival rate and make strategy accordingly.</li> <li class="tab-list-element">Lifetime Value Prediction : Engage with customers according to their lifetime value</li> <li class="tab-list-element">Active customers : Predict when the customer will be active for the next time and take interventions accordingly. * Campaign evaluation : Monitor effect of campaign on the survival rate of customers.</li> </ul> Source: http://www.analyticsvidhya.com/blog/2014/04/survival-analysis-model-you/ <p>Support: <a href="http://www.analyticsvidhya.com/blog/2014/04/survival-analysis-model-you/">Blog post</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>beta</td> <td>0.9.5</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/Bens
 onQiu/predictionio-template-recommendation-sparklingwater">Sparkling Water-Deep Learning Energy Forecasting</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=BensonQiu&amp;repo=predictionio-template-recommendation-sparklingwater&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This Engine Template demonstrates an energy forecasting engine. It integrates Deep Learning from the Sparkling Water library to perform energy analysis. We can query the circuit and time, and return predicted energy usage. </p> <p>Support: <a href="https://github.com/BensonQiu/predictionio-template-recommendation-sparklingwater/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> <
 /tr> </table> <br> <h3><a href="https://github.com/detrevid/predictionio-load-forecasting">Electric Load Forecasting</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=detrevid&amp;repo=predictionio-load-forecasting&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This is a PredictionIO engine for electric load forecasting. The engine is using linear regression with stochastic gradient descent from Spark MLlib. </p> <p>Support: <a href="https://github.com/detrevid/predictionio-load-forecasting/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/RAditi/PredictionIO-MLLib-LinReg-Template">MLLib-LinearReg
 ression</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=RAditi&amp;repo=PredictionIO-MLLib-LinReg-Template&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This template uses the linear regression with stochastic gradient descent algorithm from MLLib to make predictions on real-valued data based on features (explanatory variables) </p> <p>Support: <a href="https://github.com/RAditi/PredictionIO-MLLib-LinReg-Template/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.1</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/mgcdanny/pio-linear-regression-bfgs">Linear Regression BFGS</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=mgcdanny&amp;
 repo=pio-linear-regression-bfgs&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Modeling the relationship between a dependent variable, y, and one or more explanatory variables, denoted X. </p> <p>Support: </p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>beta</td> <td>0.10.0</td> <td></td> </tr> </table> <br> <h3><a href="https://github.com/jpioug/predictionio-template-boston-house-prices">Regression template for Boston House Prices</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=jpioug&amp;repo=predictionio-template-boston-house-prices&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This is Python(PySpark) based regression example for Boston House Prices da
 taset. </p> <p>Support: </p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Python</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.12.0-incubating</td> <td></td> </tr> </table> <br> </div> <div data-tab="NLP" id="tab-89e56441-0198-4fd7-a4bd-9b6cb937b54f"> <h3><a href="https://github.com/goliasz/pio-template-text-similarity">Cstablo-template-text-similarity-classification</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=goliasz&amp;repo=pio-template-text-similarity&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Text similarity engine based on Word2Vec algorithm. Builds vectors of full documents in training phase. Finds similar documents in query phase. </p> <p>Support: <a href="https://github.com/goliasz/pio-template-text-similarity/issues">Github issues</a></p> <b
 r> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.5</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/rajdeepd/template-Labelling-Topics-with-wikipedia">Topic Labelling with Wikipedia</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=rajdeepd&amp;repo=template-Labelling-Topics-with-wikipedia&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This template will label topics (e.g. topic generated through LDA topic modeling) with relevant category by referring to Wikipedia as a knowledge base. </p> <p>Support: <a href="https://github.com/peoplehum/template-Labelling-Topics-with-wikipedia/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>
 Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.10.0-incubating</td> <td>already compatible</td> </tr> </table> <br> <h3><a href="https://github.com/apache/predictionio-template-text-classifier">Text Classification</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=apache&amp;repo=predictionio-template-text-classifier&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Use this engine for general text classification purposes. Uses OpenNLP library for text vectorization, includes t.f.-i.d.f.-based feature transformation and reduction, and uses Spark MLLib's Multinomial Naive Bayes implementation for classification. </p> <p>Support: <a href="https://github.com/apache/predictionio-template-text-classifier/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>Lic
 ense</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/thomasste/template-scala-parallel-dl4j-rntn">Deeplearning4j RNTN</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=thomasste&amp;repo=template-scala-parallel-dl4j-rntn&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Recursive Neural Tensor Network algorithm is supervised learning algorithm used to predict sentiment of sentences. This template is based on deeplearning4j RNTN example: https://github.com/SkymindIO/deeplearning4j-nlp-examples/tree/master/src/main/java/org/deeplearning4j/rottentomatoes/rntn. It's goal is to show how to integrate deeplearning4j library with PredictionIO. </p> <p>Support: <a href="https://github.com/thomasste
 /template-scala-parallel-dl4j-rntn/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/peoplehum/BagOfWords_SentimentAnalysis_Template">Sentiment Analysis - Bag of Words Model</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=peoplehum&amp;repo=BagOfWords_SentimentAnalysis_Template&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This sentiment analysis template uses a bag of words model. Given text, the engine will return sentiment as 1.0 (positive) or 0.0 (negative) along with scores indicating how +ve or -ve it is. </p> <p>Support: <a href="https://github.com/peoplehum/BagOfWords_SentimentAnalysis_T
 emplate/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.10.0-incubating</td> <td>already compatible</td> </tr> </table> <br> <h3><a href="https://github.com/infoquestsolutions/OpenNLP-SentimentAnalysis-Template">OpenNLP Sentiment Analysis Template</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=infoquestsolutions&amp;repo=OpenNLP-SentimentAnalysis-Template&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Given a sentence, this engine will return a score between 0 and 4. This is the sentiment of the sentence. The lower the number the more negative the sentence is. It uses the OpenNLP library. </p> <p>Support: <a href="https://github.com/infoquestsolutions/OpenNLP-SentimentAnalysis-Tem
 plate/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>beta</td> <td>0.10.0-incubating</td> <td>already compatible</td> </tr> </table> <br> <h3><a href="https://github.com/pawel-n/template-scala-cml-sentiment">Sentiment analysis</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=pawel-n&amp;repo=template-scala-cml-sentiment&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This template implements various algorithms for sentiment analysis, most based on recursive neural networks (RNN) and recursive neural tensor networks (RNTN)[1]. It uses an experimental library called Composable Machine Learning (CML) and the Stanford Parser. The example data set is the Stanford Sentiment Treebank. </p> <p>Support: <a hr
 ef="https://github.com/pawel-n/template-scala-cml-sentiment/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/pawel-n/template-scala-parallel-word2vec">Word2Vec</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=pawel-n&amp;repo=template-scala-parallel-word2vec&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This template integrates the Word2Vec implementation from deeplearning4j with PredictionIO. The Word2Vec algorithm takes a corpus of text and computes a vector representation for each word. These representations can be subsequently used in many natural language processing applications. </p> <p>Su
 pport: <a href="https://github.com/pawel-n/template-scala-parallel-word2vec/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.0</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/thomasste/template-scala-spark-dl4j-word2vec">Spark Deeplearning4j Word2Vec</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=thomasste&amp;repo=template-scala-spark-dl4j-word2vec&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This template shows how to integrate Deeplearnign4j spark api with PredictionIO on example of app which uses Word2Vec algorithm to predict nearest words. </p> <p>Support: <a href="https://github.com/thomasste/template-scala-spark-dl4j-word2vec/issues">
 Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/whhone/template-sentiment-analysis">Sentiment Analysis Template</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=whhone&amp;repo=template-sentiment-analysis&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Given a sentence, return a score between 0 and 4, indicating the sentence's sentiment. 0 being very negative, 4 being very positive, 2 being neutral. The engine uses the stanford CoreNLP library and the Scala binding `gangeli/CoreNLP-Scala` for parsing. </p> <p>Support: <a href="https://github.com/whhone/template-sentiment-analysis/issues">Github issues</
 a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>None</td> <td>stable</td> <td>0.9.0</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/thomasste/template-scala-rnn">Recursive Neural Networks (Sentiment Analysis)</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=thomasste&amp;repo=template-scala-rnn&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Predicting sentiment of phrases with use of Recursive Neural Network algorithm and OpenNLP parser. </p> <p>Support: <a href="https://github.com/thomasste/template-scala-rnn/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> 
 <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/Ling-Ling/CoreNLP-Text-Classification">CoreNLP Text Classification</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=Ling-Ling&amp;repo=CoreNLP-Text-Classification&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This engine uses CoreNLP to do text analysis in order to classify the category a strings of text falls under. </p> <p>Support: <a href="https://github.com/Ling-Ling/CoreNLP-Text-Classification/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>-</td> <td>requires conversion</td> </tr> </table> <br> </div> <div data-tab="Clustering
 " id="tab-3598e24d-ad55-47d4-beca-27b22e978ef8"> <h3><a href="https://github.com/sahiliitm/predictionio-MLlibKMeansClusteringTemplate">MLlibKMeansClustering</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=sahiliitm&amp;repo=predictionio-MLlibKMeansClusteringTemplate&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This is a template which demonstrates the use of K-Means clustering algorithm which can be deployed on a spark-cluster using prediction.io. </p> <p>Support: <a href="https://github.com/sahiliitm/predictionio-MLlibKMeansClusteringTemplate/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>-</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/Emerg
 entOrder/template-scala-topic-model-LDA">Topc Model (LDA)</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=EmergentOrder&amp;repo=template-scala-topic-model-LDA&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> A PredictionIO engine template using Latent Dirichlet Allocation to learn a topic model from raw text </p> <p>Support: <a href="https://github.com/EmergentOrder/template-scala-topic-model-LDA/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.4</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/singsanj/KMeans-parallel-template">KMeans-Clustering-Template</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=singsanj&amp;repo=KMeans-paral
 lel-template&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> forked from PredictionIO/template-scala-parallel-vanilla. It implements the KMeans Algorithm. Can be extended to mainstream implementation with minor changes. </p> <p>Support: <a href="https://github.com/singsanj/KMeans-parallel-template/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/rajdeepd/template-Labelling-Topics-with-wikipedia">Topic Labelling with Wikipedia</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=rajdeepd&amp;repo=template-Labelling-Topics-with-wikipedia&amp;type=star&amp;count=true" frameborder="0" align="middle" scrol
 ling="0" width="170px" height="20px"></iframe> <p> This template will label topics (e.g. topic generated through LDA topic modeling) with relevant category by referring to Wikipedia as a knowledge base. </p> <p>Support: <a href="https://github.com/peoplehum/template-Labelling-Topics-with-wikipedia/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.10.0-incubating</td> <td>already compatible</td> </tr> </table> <br> </div> <div data-tab="Similarity" id="tab-1af5e6b8-4385-43ca-93c6-f5b847615b8f"> <h3><a href="https://github.com/alexice/template-scala-parallel-svd-item-similarity">Content Based SVD Item Similarity Engine</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=alexice&amp;repo=template-scala-parallel-svd-item-similarity&amp;type=star&amp;count=true
 " frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Template to calculate similarity between items based on their attributes—sometimes called content-based similarity. Attributes can be either numeric or categorical in the last case it will be encoded using one-hot encoder. Algorithm uses SVD in order to reduce data dimensionality. Cosine similarity is now implemented but can be easily extended to other similarity measures. </p> <p>Support: <a href="https://groups.google.com/forum/#!forum/actionml-user">The Universal Recommender user group</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.2</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/goliasz/pio-template-text-similarity">Cstablo-template-text-similarity-cla
 ssification</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=goliasz&amp;repo=pio-template-text-similarity&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Text similarity engine based on Word2Vec algorithm. Builds vectors of full documents in training phase. Finds similar documents in query phase. </p> <p>Support: <a href="https://github.com/goliasz/pio-template-text-similarity/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.5</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/ramaboo/template-scala-parallel-similarproduct-with-rating">Similar Product with Rating</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=ramaboo&amp;repo=templat
 e-scala-parallel-similarproduct-with-rating&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Similar product template with rating support! Used for the MovieLens Demo. </p> <p>Support: <a href="https://github.com/ramaboo/template-scala-parallel-similarproduct-with-rating/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>beta</td> <td>0.9.0</td> <td>requires conversion</td> </tr> </table> <br> </div> <div data-tab="Other" id="tab-92bc728a-a951-4232-8401-9cf98b2fa5dd"> <h3><a href="https://github.com/goliasz/pio-template-fpm">Frequent Pattern Mining</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=goliasz&amp;repo=pio-template-fpm&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" w
 idth="170px" height="20px"></iframe> <p> Template uses FP Growth algorithm allowing to mine for frequent patterns. Template returns subsequent items together with confidence score. </p> <p>Support: <a href="https://github.com/goliasz/pio-template-fpm/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>alpha</td> <td>0.9.5</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/anthill/template-decision-tree-feature-importance">template-decision-tree-feature-importance</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=anthill&amp;repo=template-decision-tree-feature-importance&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> This template shows how to use spark' decision tree. It
  enables : - both categorical and continuous features - feature importance calculation - tree output in json - reading training data from a csv file </p> <p>Support: <a href="https://github.com/anthill/template-decision-tree-feature-importance/issues">Github issues</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.9.0</td> <td>requires conversion</td> </tr> </table> <br> <h3><a href="https://github.com/apache/predictionio-template-skeleton">Skeleton</a></h3> <iframe src="https://ghbtns.com/github-btn.html?user=apache&amp;repo=predictionio-template-skeleton&amp;type=star&amp;count=true" frameborder="0" align="middle" scrolling="0" width="170px" height="20px"></iframe> <p> Skeleton template is for developing new engine when you find other engine templates do not fit your needs. This templa
 te provides a skeleton to kick start new engine development. </p> <p>Support: <a href="http://predictionio.apache.org/support/">Apache PredictionIO mailing lists</a></p> <br> <table> <tr> <th>Type</th> <th>Language</th> <th>License</th> <th>Status</th> <th>PIO min version</th> <th>Apache PIO Convesion Required</th> </tr> <tr> <td>Parallel</td> <td>Scala</td> <td>Apache Licence 2.0</td> <td>stable</td> <td>0.9.2</td> <td>already compatible</td> </tr> </table> <br> </div> </div> </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-subscribe@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/contribute-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-subscribe@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 trademark
 s 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="social-icons-wrapper"><a class="github-button" href="https://github.com/apache/predictionio" data-style="mega" data-count-href="/apache/predictionio/stargazers" data-count-api="/repos/apache/predictionio#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star apache/predictionio on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/predictionio/fork" data-icon="octicon-git-branch" data-style="mega" data-count-href="/apache/predictionio/network" data-count-api="/repos/apache/predictionio#forks_count" data-count-aria-label="# forks on GitHub" 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(){
+<!DOCTYPE html><html><head><title>Engine Template Gallery</title><meta charset="utf-8"/><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta class="swiftype" name="title" data-type="string" content="Engine Template Gallery"/><link rel="canonical" href="https://predictionio.apache.org/gallery/template-gallery/"/><link href="/images/favicon/normal-b330020a.png" rel="shortcut icon"/><link href="/images/favicon/apple-c0febcf2.png" rel="apple-touch-icon"/><link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet"/><link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/><link href="/stylesheets/application-eccfc6cb.css" rel="stylesheet" type="text/css"/><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><script src="//cdn.mathjax.org/math
 jax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><script src="//use.typekit.net/pqo0itb.js"></script><script>try{Typekit.load({ async: true });}catch(e){}</script></head><body><div id="global"><header><div class="container" id="header-wrapper"><div class="row"><div class="col-sm-12"><div id="logo-wrapper"><span id="drawer-toggle"></span><a href="#"></a><a href="http://predictionio.apache.org/"><img alt="Apache PredictionIO" id="logo" src="/images/logos/logo-ee2b9bb3.png"/></a><span>®</span></div><div id="menu-wrapper"><div id="pill-wrapper"><a class="pill left" href="/gallery/template-gallery">TEMPLATES</a> <a class="pill right" href="//github.com/apache/predictionio/">OPEN SOURCE</a></div></div><img class="mobile-search-bar-toggler hidden-md hidden-lg" src="/images/icons/search-glass-704bd4ff.png"/></div></div></div></header><div id="search-bar-row-wrapper"><div class="container-fluid" id="search-bar-row"><div class="row"><div class="col-md-9 col-sm-11 col-xs-11"><div 
 class="hidden-md hidden-lg" id="mobile-page-heading-wrapper"><p>PredictionIO Docs</p><h4>Browse</h4></div><h4 class="hidden-sm hidden-xs">PredictionIO Docs</h4></div><div class="col-md-3 col-sm-1 col-xs-1 hidden-md hidden-lg"><img id="left-menu-indicator" src="/images/icons/down-arrow-dfe9f7fe.png"/></div><div class="col-md-3 col-sm-12 col-xs-12 swiftype-wrapper"><div class="swiftype"><form class="search-form"><img class="search-box-toggler hidden-xs hidden-sm" src="/images/icons/search-glass-704bd4ff.png"/><div class="search-box"><img src="/images/icons/search-glass-704bd4ff.png"/><input type="text" id="st-search-input" class="st-search-input" placeholder="Search Doc..."/></div><img class="swiftype-row-hider hidden-md hidden-lg" src="/images/icons/drawer-toggle-active-fcbef12a.png"/></form></div></div><div class="mobile-left-menu-toggler hidden-md hidden-lg"></div></div></div></div><div id="page" class="container-fluid"><div class="row"><div id="left-menu-wrapper" class="col-md-3">
 <nav id="nav-main"><ul><li class="level-1"><a class="expandible" href="/"><span>Apache PredictionIO® Documentation</span></a><ul><li class="level-2"><a class="final" href="/"><span>Welcome to Apache PredictionIO®</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Getting Started</span></a><ul><li class="level-2"><a class="final" href="/start/"><span>A Quick Intro</span></a></li><li class="level-2"><a class="final" href="/install/"><span>Installing Apache PredictionIO</span></a></li><li class="level-2"><a class="final" href="/start/download/"><span>Downloading an Engine Template</span></a></li><li class="level-2"><a class="final" href="/start/deploy/"><span>Deploying Your First Engine</span></a></li><li class="level-2"><a class="final" href="/start/customize/"><span>Customizing the Engine</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Integrating with Your App</span></a><ul><li class="level-2"><a class="final" href="
 /appintegration/"><span>App Integration Overview</span></a></li><li class="level-2"><a class="expandible" href="/sdk/"><span>List of SDKs</span></a><ul><li class="level-3"><a class="final" href="/sdk/java/"><span>Java & Android SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/php/"><span>PHP SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/python/"><span>Python SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/ruby/"><span>Ruby SDK</span></a></li><li class="level-3"><a class="final" href="/sdk/community/"><span>Community Powered SDKs</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Deploying an Engine</span></a><ul><li class="level-2"><a class="final" href="/deploy/"><span>Deploying as a Web Service</span></a></li><li class="level-2"><a class="final" href="/batchpredict/"><span>Batch Predictions</span></a></li><li class="level-2"><a class="final" href="/deploy/monitoring/"><span>Monitorin
 g Engine</span></a></li><li class="level-2"><a class="final" href="/deploy/engineparams/"><span>Setting Engine Parameters</span></a></li><li class="level-2"><a class="final" href="/deploy/enginevariants/"><span>Deploying Multiple Engine Variants</span></a></li><li class="level-2"><a class="final" href="/deploy/plugin/"><span>Engine Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Customizing an Engine</span></a><ul><li class="level-2"><a class="final" href="/customize/"><span>Learning DASE</span></a></li><li class="level-2"><a class="final" href="/customize/dase/"><span>Implement DASE</span></a></li><li class="level-2"><a class="final" href="/customize/troubleshooting/"><span>Troubleshooting Engine Development</span></a></li><li class="level-2"><a class="final" href="/api/current/#package"><span>Engine Scala APIs</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Collecting and Analyzing Data</span></a><ul
 ><li class="level-2"><a class="final" href="/datacollection/"><span>Event Server Overview</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventapi/"><span>Collecting Data with REST/SDKs</span></a></li><li class="level-2"><a class="final" href="/datacollection/eventmodel/"><span>Events Modeling</span></a></li><li class="level-2"><a class="final" href="/datacollection/webhooks/"><span>Unifying Multichannel Data with Webhooks</span></a></li><li class="level-2"><a class="final" href="/datacollection/channel/"><span>Channel</span></a></li><li class="level-2"><a class="final" href="/datacollection/batchimport/"><span>Importing Data in Batch</span></a></li><li class="level-2"><a class="final" href="/datacollection/analytics/"><span>Using Analytics Tools</span></a></li><li class="level-2"><a class="final" href="/datacollection/plugin/"><span>Event Server Plugin</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Choosing an Algorithm(s
 )</span></a><ul><li class="level-2"><a class="final" href="/algorithm/"><span>Built-in Algorithm Libraries</span></a></li><li class="level-2"><a class="final" href="/algorithm/switch/"><span>Switching to Another Algorithm</span></a></li><li class="level-2"><a class="final" href="/algorithm/multiple/"><span>Combining Multiple Algorithms</span></a></li><li class="level-2"><a class="final" href="/algorithm/custom/"><span>Adding Your Own Algorithms</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>ML Tuning and Evaluation</span></a><ul><li class="level-2"><a class="final" href="/evaluation/"><span>Overview</span></a></li><li class="level-2"><a class="final" href="/evaluation/paramtuning/"><span>Hyperparameter Tuning</span></a></li><li class="level-2"><a class="final" href="/evaluation/evaluationdashboard/"><span>Evaluation Dashboard</span></a></li><li class="level-2"><a class="final" href="/evaluation/metricchoose/"><span>Choosing Evaluation Metrics</span
 ></a></li><li class="level-2"><a class="final" href="/evaluation/metricbuild/"><span>Building Evaluation Metrics</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>System Architecture</span></a><ul><li class="level-2"><a class="final" href="/system/"><span>Architecture Overview</span></a></li><li class="level-2"><a class="final" href="/system/anotherdatastore/"><span>Using Another Data Store</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>PredictionIO® Official Templates</span></a><ul><li class="level-2"><a class="final" href="/templates/"><span>Intro</span></a></li><li class="level-2"><a class="expandible" href="#"><span>Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/recommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/r
 ecommendation/evaluation/"><span>Evaluation Explained</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/reading-custom-events/"><span>Read Custom Events</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-data-prep/"><span>Customize Data Preparator</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/customize-serving/"><span>Customize Serving</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/training-with-implicit-preference/"><span>Train with Implicit Preference</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/blacklist-items/"><span>Filter Recommended Items by Blacklist in Query</span></a></li><li class="level-3"><a class="final" href="/templates/recommendation/batch-evaluator/"><span>Batch Persistable 
 Evaluator</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>E-Commerce Recommendation</span></a><ul><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/ecommercerecommendation/adjust-score/"><span>Adjust Score</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Similar Product</span></a><ul><li class="level-3"><a class="final" href="/templates/similarproduct/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="f
 inal" href="/templates/similarproduct/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/multi-events-multi-algos/"><span>Multiple Events and Multiple Algorithms</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/return-item-properties/"><span>Returns Item Properties</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/train-with-rate-event/"><span>Train with Rate Event</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/rid-user-set-event/"><span>Get Rid of Events for Users</span></a></li><li class="level-3"><a class="final" href="/templates/similarproduct/recommended-user/"><span>Recommend Users</span></a></li></ul></li><li class="level-2"><a class="expandible" href="#"><span>Classification</span></a><ul><li class="level-3"><a class
 ="final" href="/templates/classification/quickstart/"><span>Quick Start</span></a></li><li class="level-3"><a class="final" href="/templates/classification/dase/"><span>DASE</span></a></li><li class="level-3"><a class="final" href="/templates/classification/how-to/"><span>How-To</span></a></li><li class="level-3"><a class="final" href="/templates/classification/add-algorithm/"><span>Use Alternative Algorithm</span></a></li><li class="level-3"><a class="final" href="/templates/classification/reading-custom-properties/"><span>Read Custom Properties</span></a></li></ul></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Engine Template Gallery</span></a><ul><li class="level-2"><a class="final active" href="/gallery/template-gallery/"><span>Browse</span></a></li><li class="level-2"><a class="final" href="/community/submit-template/"><span>Submit your Engine as a Template</span></a></li></ul></li><li class="level-1"><a class="expandible" href="#"><span>Demo Tutorials<
 /span></a><ul><li class="level-2"><a class="final" href="/demo/tapster/"><span>Comics Recommendation Demo</span></a></li><li class="level-2"><a class="final" href="/demo/community/"><span>Community Contributed Demo</span></a></li><li class="level-2"><a class="final" href="/demo/textclassification/"><span>Text Classification Engine Tutorial</span></a></li></ul></li><li class="level-1"><a class="expandible" href="/community/"><span>Getting Involved</span></a><ul><li class="level-2"><a class="final" href="/community/contribute-code/"><span>Contribute Code</span></a></li><li class="level-2"><a class="final" href="/community/contribute-documentation/"><span>Contribute Documentation</span></a></li><li class="level-2"><a class="final" href="/community/contribute-sdk/"><span>Contribute a SDK</span></a></li><li class="level-2"><a class="final" href="/community/contribute-webhook/"><span>Contribute a Webhook</span></a></

<TRUNCATED>


[07/11] predictionio-site git commit: Documentation based on apache/predictionio#54415e1066ae2d646eef62ebfdf801ace1de2097

Posted by gi...@apache.org.
http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/sitemap.xml
----------------------------------------------------------------------
diff --git a/sitemap.xml b/sitemap.xml
index 1b416b6..c19b7a3 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -2,781 +2,781 @@
 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <url>
     <loc>//predictionio.apache.org/datacollection/plugin/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/datacollection/eventapi/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/datacollection/channel/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/datacollection/webhooks/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/datacollection/analytics-zeppelin/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/datacollection/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/datacollection/analytics-ipynb/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/datacollection/analytics-tableau/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/datacollection/batchimport/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/datacollection/eventmodel/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/datacollection/analytics/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/resources/intellij/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/resources/glossary/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/resources/release/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/resources/faq/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/resources/upgrade/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/404/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/support/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/demo/textclassification/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/demo/community/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/demo/supervisedlearning/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/demo/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/demo/tapster/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/algorithm/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/algorithm/custom/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/algorithm/switch/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/algorithm/multiple/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/install/install-sourcecode/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/install/config-datastore/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/install/sdk/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/install/launch-aws/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/install/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/install/install-linux/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/install/install-vagrant/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/cli/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/gallery/template-gallery/</loc>
-    <lastmod>2018-07-31T21:25:08+00:00</lastmod>
+    <lastmod>2018-08-11T00:20:35+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/tryit/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/machinelearning/dimensionalityreduction/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/machinelearning/modelingworkflow/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/production/deploy-cloudformation/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/customize/dase/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/customize/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/customize/troubleshooting/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/evaluation/paramtuning/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/evaluation/metricbuild/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/evaluation/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/evaluation/evaluationdashboard/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/evaluation/history/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/evaluation/metricchoose/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/start/deploy/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/start/customize/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/start/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/start/download/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/similarproduct/how-to/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/similarproduct/dase/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/similarproduct/rid-user-set-event/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/similarproduct/quickstart/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/similarproduct/multi-events-multi-algos/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/similarproduct/recommended-user/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/similarproduct/return-item-properties/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/similarproduct/train-with-rate-event/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/ecommercerecommendation/how-to/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/ecommercerecommendation/dase/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/ecommercerecommendation/quickstart/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/ecommercerecommendation/adjust-score/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/ecommercerecommendation/train-with-rate-event/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/classification/how-to/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/classification/add-algorithm/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/classification/dase/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/classification/quickstart/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/classification/reading-custom-properties/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/javaecommercerecommendation/dase/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/javaecommercerecommendation/quickstart/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/vanilla/dase/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/vanilla/quickstart/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/productranking/dase/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/productranking/quickstart/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/complementarypurchase/dase/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/complementarypurchase/quickstart/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/recommendation/customize-serving/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/recommendation/how-to/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/recommendation/dase/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/recommendation/customize-data-prep/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/recommendation/quickstart/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/recommendation/evaluation/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/recommendation/training-with-implicit-preference/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/recommendation/blacklist-items/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/recommendation/reading-custom-events/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/recommendation/batch-evaluator/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/leadscoring/dase/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/templates/leadscoring/quickstart/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/deploy/plugin/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/deploy/enginevariants/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/deploy/monitoring/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/deploy/engineparams/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/deploy/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/search/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/system/anotherdatastore/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/system/deploy-cloudformation/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/system/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/community/contribute-code/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/community/projects/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/community/contribute-webhook/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/community/contribute-sdk/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/community/submit-template/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/community/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/community/contribute-documentation/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/samples/level-3-2/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/samples/level-2-1/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/samples/level-2-2/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/samples/level-1/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/samples/level-4/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/samples/level-4-1/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/samples/level-3/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/samples/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/samples/level-2/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/samples/level-4-2/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/samples/level-3-1/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/samples/level-4-3/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/sdk/php/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/sdk/ruby/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/sdk/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/sdk/community/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/sdk/python/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/sdk/java/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:44+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/batchpredict/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/appintegration/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>
   <url>
     <loc>//predictionio.apache.org/github/</loc>
-    <lastmod>2018-07-31T21:22:10+00:00</lastmod>
+    <lastmod>2018-08-11T00:17:43+00:00</lastmod>
     <changefreq>monthly</changefreq>
     <priority>0.5</priority>
   </url>

http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/templates/classification/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/classification/quickstart/index.html b/templates/classification/quickstart/index.html
index 7ffd5cc..02b26cd 100644
--- a/templates/classification/quickstart/index.html
+++ b/templates/classification/quickstart/index.html
@@ -32,7 +32,7 @@ Your system is all ready to go.
 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span>               MyApp1 |    1 | 3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F | <span class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span>               MyApp2 |    2 | io5lz6Eg4m3Xe4JZTBFE13GMAf1dhFl6ZteuJfrO84XpdOz9wRCrDU44EUaYuXq5 | <span class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span class="nv">$]</span> Finished listing 2 app<span class="o">(</span>s<span class="o">)</span>.
-</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, let&#39;s collect some training data. By default, the Classification Engine Template reads 4 properties of a user record: attr0, attr1, attr2 and plan. This templates requires &#39;$set&#39; user events.</p><div class="alert-message info"><p>This template can easily be customized to use different or more number of attributes.</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>loc
 alhost: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>To set properties &quot;attr0&quot;, &quot;attr1&quot;, &quot;attr2&quot; and &quot;plan&quot; for user &quot;u0&quot; 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 <code>$set</code> event for the 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-fd41fc24-badc-4133-8f93-7f6d77a2d6cc">REST API</a></li> <li data-lang="python"><a href="#tab-8afefce9-201f-45b9-a124-590d85e749eb">Python SDK</a></li> <li data-lang="php"><a href="#tab-859c04dd-1125-44a8-8c01-54870ed94f8d">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-031c5f48-6349-44bb-b3b1-f989fc1778c1">Ruby SDK</a></li> <li data-lang="java"><a href="#
 tab-2110713f-3e42-4afb-b3d4-de1afc0cfe3e">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-fd41fc24-badc-4133-8f93-7f6d77a2d6cc"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, let&#39;s collect some training data. By default, the Classification Engine Template reads 4 properties of a user record: attr0, attr1, attr2 and plan. This templates requires &#39;$set&#39; user events.</p><div class="alert-message info"><p>This template can easily be customized to use different or more number of attributes.</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>loc
 alhost: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>To set properties &quot;attr0&quot;, &quot;attr1&quot;, &quot;attr2&quot; and &quot;plan&quot; for user &quot;u0&quot; 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 <code>$set</code> event for the 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-85a02916-b1d2-424d-86f8-fbfad8a40e9e">REST API</a></li> <li data-lang="python"><a href="#tab-e1b69c67-a722-4821-9f64-def539a73ba7">Python SDK</a></li> <li data-lang="php"><a href="#tab-18013c0e-9b94-410f-8dfb-ea72ffc73474">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-da0c7441-fc45-4ccc-b684-7ec375ac7ff0">Ruby SDK</a></li> <li data-lang="java"><a href="#
 tab-5ccfccb3-992a-44de-9ff1-67b394445237">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-85a02916-b1d2-424d-86f8-fbfad8a40e9e"> <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
@@ -59,7 +59,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-8afefce9-201f-45b9-a124-590d85e749eb"> <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-e1b69c67-a722-4821-9f64-def539a73ba7"> <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
@@ -100,7 +100,7 @@ Your system is all ready to go.
       <span class="s">"plan"</span> <span class="p">:</span> <span class="nb">int</span><span class="p">(</span><span class="o">&lt;</span><span class="n">VALUE</span> <span class="n">OF</span> <span class="n">PLAN</span><span class="o">&gt;</span><span class="p">)</span>
     <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-859c04dd-1125-44a8-8c01-54870ed94f8d"> <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-18013c0e-9b94-410f-8dfb-ea72ffc73474"> <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
@@ -137,7 +137,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-031c5f48-6349-44bb-b3b1-f989fc1778c1"> <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-da0c7441-fc45-4ccc-b684-7ec375ac7ff0"> <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
@@ -168,7 +168,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-2110713f-3e42-4afb-b3d4-de1afc0cfe3e"> <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-5ccfccb3-992a-44de-9ff1-67b394445237"> <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
@@ -203,7 +203,7 @@ Your system is all ready to go.
         <span class="s">"plan"</span><span class="o">,</span> <span class="o">&lt;</span><span class="n">VALUE</span> <span class="n">OF</span> <span class="n">PLAN</span><span class="o">&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">event</span><span class="o">);</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>Note that you can also set the properties for the user with multiple <code>$set</code> events (They will be aggregated during engine training).</p><p>To set properties &quot;attr0&quot;, &quot;attr1&quot; and &quot;attr2&quot;, and &quot;plan&quot; for user &quot;u1&quot; at different time, you can send follwing <code>$set</code> events for the user. To send these events, run the following <code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-916a852a-bdbe-4712-916f-859f7a9328b6">REST API</a></li> <li data-lang="python"><a href="#tab-ac1784ab-fe9d-4fe5-8f66-ecc08ca85f1a">Python SDK</a></li> <li data-lang="php"><a href="#tab-a09d7f03-5f85-4893-9543-a74de040893e">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-9dd4c04e-5634-4715-97ad-d260d914f821">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-20cc7bfc-d4b9-4bfd-8275-699c48b8a7aa">Java SDK</a></li> </ul> <div data-tab
 ="REST API" data-lang="json" id="tab-916a852a-bdbe-4712-916f-859f7a9328b6"> <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>Note that you can also set the properties for the user with multiple <code>$set</code> events (They will be aggregated during engine training).</p><p>To set properties &quot;attr0&quot;, &quot;attr1&quot; and &quot;attr2&quot;, and &quot;plan&quot; for user &quot;u1&quot; at different time, you can send follwing <code>$set</code> events for the user. To send these events, run the following <code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-e6b078db-e93b-4dc2-ab1c-5daebe59c69a">REST API</a></li> <li data-lang="python"><a href="#tab-58c1f388-125e-4c50-b679-59fb9f5002d1">Python SDK</a></li> <li data-lang="php"><a href="#tab-8e5b56be-60ec-4b2c-a60b-f1c922887925">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-d14ceda4-c1bc-4836-a522-36788f2c235f">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-3bf79f48-0ed0-4c0f-b4d7-cfcc0037edaa">Java SDK</a></li> </ul> <div data-tab
 ="REST API" data-lang="json" id="tab-e6b078db-e93b-4dc2-ab1c-5daebe59c69a"> <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
@@ -274,7 +274,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-ac1784ab-fe9d-4fe5-8f66-ecc08ca85f1a"> <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-58c1f388-125e-4c50-b679-59fb9f5002d1"> <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
@@ -327,7 +327,7 @@ Your system is all ready to go.
       <span class="s">"plan"</span> <span class="p">:</span> <span class="nb">int</span><span class="p">(</span><span class="o">&lt;</span><span class="n">VALUE</span> <span class="n">OF</span> <span class="n">PLAN</span><span class="o">&gt;</span><span class="p">)</span>
     <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-a09d7f03-5f85-4893-9543-a74de040893e"> <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-8e5b56be-60ec-4b2c-a60b-f1c922887925"> <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
@@ -390,7 +390,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-9dd4c04e-5634-4715-97ad-d260d914f821"> <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-d14ceda4-c1bc-4836-a522-36788f2c235f"> <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
@@ -433,7 +433,7 @@ Your system is all ready to go.
 <span class="p">)</span>
 
 <span class="c1"># Etc...</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-20cc7bfc-d4b9-4bfd-8275-699c48b8a7aa"> <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-3bf79f48-0ed0-4c0f-b4d7-cfcc0037edaa"> <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
@@ -497,17 +497,17 @@ Your system is all ready to go.
 </pre></td></tr></tbody></table> </div> <p>When the engine is deployed successfully and running, you should see a console message similar to the following:</p><div class="highlight shell"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2</pre></td><td class="code"><pre><span class="o">[</span>INFO] <span class="o">[</span>HttpListener] Bound to /0.0.0.0:8000
 <span class="o">[</span>INFO] <span class="o">[</span>MasterActor] Bind successful. Ready to serve.
-</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine process.</p><p>By default, the deployed engine binds to <a href="http://localhost:8000"><a href="http://localhost:8000">http://localhost:8000</a></a>. You can visit that page in your web browser to check its status.</p><p><img alt="Engine Status" src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' class='header-anchors'>6. Use the Engine</h2><p>Now, You can try to retrieve predicted results. For example, to predict the label (i.e. <em>plan</em> in this case) of a user with attr0=2, attr1=0 and attr2=0, you send this JSON <code>{ &quot;attr0&quot;:2, &quot;attr1&quot;:0, &quot;attr2&quot;:0 }</code> to the deployed engine and it will return a JSON of the predicted plan. 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 t
 o send the query:</p><div class="tabs"> <ul class="control"> <li data-lang="bash"><a href="#tab-ff5a583d-5f52-4939-820b-788c48a83ca0">REST API</a></li> <li data-lang="python"><a href="#tab-7d6fb6ca-3b8e-4523-a7b7-388f5550f080">Python SDK</a></li> <li data-lang="php"><a href="#tab-1dfd85e1-43b9-4cd0-a89b-987d4c49be0d">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-ace019fe-6b72-4863-b168-0d75817edd15">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-24d898c6-674f-4dbb-b34a-e941e7e7a16c">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="bash" id="tab-ff5a583d-5f52-4939-820b-788c48a83ca0"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine process.</p><p>By default, the deployed engine binds to <a href="http://localhost:8000"><a href="http://localhost:8000">http://localhost:8000</a></a>. You can visit that page in your web browser to check its status.</p><p><img alt="Engine Status" src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' class='header-anchors'>6. Use the Engine</h2><p>Now, You can try to retrieve predicted results. For example, to predict the label (i.e. <em>plan</em> in this case) of a user with attr0=2, attr1=0 and attr2=0, you send this JSON <code>{ &quot;attr0&quot;:2, &quot;attr1&quot;:0, &quot;attr2&quot;:0 }</code> to the deployed engine and it will return a JSON of the predicted plan. 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 t
 o send the query:</p><div class="tabs"> <ul class="control"> <li data-lang="bash"><a href="#tab-15014cc7-016e-4a18-86ae-0855ec182b83">REST API</a></li> <li data-lang="python"><a href="#tab-641eef27-9813-446c-867d-29cb967c15a6">Python SDK</a></li> <li data-lang="php"><a href="#tab-721f686e-ca25-4a9a-8be2-96caef35f063">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-f1474ecf-36c1-4273-abee-f86ca558d3d2">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-7fb18661-b682-44da-8136-16fd689397d9">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="bash" id="tab-15014cc7-016e-4a18-86ae-0855ec182b83"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3</pre></td> <td class="code"><pre><span class="gp">$ </span>curl -H <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
 -d <span class="s1">'{ "attr0":2, "attr1":0, "attr2":0 }'</span> http://localhost:8000/queries.json
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-7d6fb6ca-3b8e-4523-a7b7-388f5550f080"> <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-641eef27-9813-446c-867d-29cb967c15a6"> <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">"attr0"</span><span class="p">:</span><span class="mi">2</span><span class="p">,</span> <span class="s">"attr1"</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span> <span class="s">"attr2"</span><span class="p">:</span><span class="mi">0</span><span class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-1dfd85e1-43b9-4cd0-a89b-987d4c49be0d"> <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-721f686e-ca25-4a9a-8be2-96caef35f063"> <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
@@ -526,7 +526,7 @@ Your system is all ready to go.
 <span class="nb">print_r</span><span class="p">(</span><span class="nv">$response</span><span class="p">);</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" data-lang="ruby" id="tab-ace019fe-6b72-4863-b168-0d75817edd15"> <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-f1474ecf-36c1-4273-abee-f86ca558d3d2"> <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
@@ -539,7 +539,7 @@ Your system is all ready to go.
 <span class="n">response</span> <span class="o">=</span> <span class="n">client</span><span class="p">.</span><span class="nf">send_query</span><span class="p">(</span><span class="s1">'attr0'</span> <span class="o">=&gt;</span> <span class="mi">2</span><span class="p">,</span> <span class="s1">'attr1'</span> <span class="o">=&gt;</span> <span class="mi">0</span><span class="p">,</span> <span class="s1">'attr2'</span> <span class="o">=&gt;</span> <span class="mi">0</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-24d898c6-674f-4dbb-b34a-e941e7e7a16c"> <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-7fb18661-b682-44da-8136-16fd689397d9"> <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/c17b9607/templates/complementarypurchase/dase/index.html
----------------------------------------------------------------------
diff --git a/templates/complementarypurchase/dase/index.html b/templates/complementarypurchase/dase/index.html
index 175ef6f..cf8bce0 100644
--- a/templates/complementarypurchase/dase/index.html
+++ b/templates/complementarypurchase/dase/index.html
@@ -212,7 +212,7 @@
   <span class="n">maxNumRulesPerCond</span><span class="k">:</span> <span class="kt">Int</span> <span class="c1">// max number of rules per condition
 </span>  <span class="o">)</span> <span class="k">extends</span> <span class="nc">Params</span>
 
-</pre></td></tr></tbody></table> </div> <p>Parameter description:</p> <ul> <li><strong>basketWindow</strong>: The buy event is considered as the same basket as previous one if the time difference is within this window (in unit of seconds). For example, if it&#39;s set to 120, it means that if the user buys item B within 2 minutes of previous purchase (item A), then the item set [A, B] is considered as the same basket. The purchase of this <em>basket</em> is referred as one <em>transaction</em>.</li> <li><strong>maxRuleLength</strong>: The maximum length of the association rule length. Must be at least 2. For example, rule of &quot;A implies B&quot; has length of 2 while rule &quot;A, B implies C&quot; has a length of 3. Increasing this number will incrase the training time significantly because more combinations are considered.</li> <li><strong>minSupport</strong>: The minimum required <em>support</em> for the item set to be considered as rule (valid range is 0 to 1). It&#39;s the p
 ercentage of the item set appearing among all transcations. This is used to filter out infrequent item set. For example, setting to 0.1 means that the item set must appear in 10 % of all transactions.</li> <li><strong>minConfidence</strong>: The minimum <em>confidence</em> required for the rules (valid range is 0 to 1). The confidence indicates the probability of the condition and conseuquence appear in the same transaction. For example, if A appears in 30 transactions and the item set [A, B] appears in 20 transactions, then the rule &quot;A implies B&quot; has confidence of 0.66.</li> <li><strong>minLift</strong>: The minimum <em>lift</em> required for the rule. It should be set to 1 to find high quality rule. It&#39;s the confidence of the rule divided by the support of the consequence. It is used to filter out rules that the consequence is very frequent anyway regardless of the condition.</li> <li><strong>minBasketSize</strong>: The minimum number of items in basket to be conside
 red by algorithm. This value must be at least 2.</li> <li><strong>maxNumRulesPerCond</strong>: Maximum number of rules generated per condition and stored in the model. By default, the top rules are sorted by <em>lift</em> score.</li> </ul> <div class="alert-message info"><p>If you import your own data and the engine doesn&#39;t return any results, it could be caused by the following reasons: (1) the algorithm parameter constraint is too high and the algo couldn&#39;t find rules that satisfy the condition. you could try setting the following param to 0: <strong>minSupport</strong>, <strong>minConfidence</strong>, <strong>minLift</strong> and then see if anything returned (regardless of recommendation quality), and then adjust the parameter accordingly. (2) the complementary purchase engine requires buy event with correct eventTime. If you import data without specifying eventTime, the SDK will use current time because it assumes the event happens in real time (which is not the case if
  you import as batch offline), resulting in that all buy events are treated as one big transcation while they should be treated as multiple transcations.</p></div><p>The values of these parameters can be specified in <em>algorithms</em> of MyComplementaryPurchase/<strong><em>engine.json</em></strong>:</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></tr></tbody></table> </div> <p>Parameter description:</p> <ul> <li><strong>basketWindow</strong>: The buy event is considered as the same basket as previous one if the time difference is within this window (in unit of seconds). For example, if it&#39;s set to 120, it means that if the user buys item B within 2 minutes of previous purchase (item A), then the item set [A, B] is considered as the same basket. The purchase of this <em>basket</em> is referred as one <em>transaction</em>.</li> <li><strong>maxRuleLength</strong>: The maximum length of the association rule length. Must be at least 2. For example, rule of &quot;A implies B&quot; has length of 2 while rule &quot;A, B implies C&quot; has a length of 3. Increasing this number will incrase the training time significantly because more combinations are considered.</li> <li><strong>minSupport</strong>: The minimum required <em>support</em> for the item set to be considered as rule (valid range is 0 to 1). It&#39;s the p
 ercentage of the item set appearing among all transactions. This is used to filter out infrequent item set. For example, setting to 0.1 means that the item set must appear in 10 % of all transactions.</li> <li><strong>minConfidence</strong>: The minimum <em>confidence</em> required for the rules (valid range is 0 to 1). The confidence indicates the probability of the condition and conseuquence appear in the same transaction. For example, if A appears in 30 transactions and the item set [A, B] appears in 20 transactions, then the rule &quot;A implies B&quot; has confidence of 0.66.</li> <li><strong>minLift</strong>: The minimum <em>lift</em> required for the rule. It should be set to 1 to find high quality rule. It&#39;s the confidence of the rule divided by the support of the consequence. It is used to filter out rules that the consequence is very frequent anyway regardless of the condition.</li> <li><strong>minBasketSize</strong>: The minimum number of items in basket to be conside
 red by algorithm. This value must be at least 2.</li> <li><strong>maxNumRulesPerCond</strong>: Maximum number of rules generated per condition and stored in the model. By default, the top rules are sorted by <em>lift</em> score.</li> </ul> <div class="alert-message info"><p>If you import your own data and the engine doesn&#39;t return any results, it could be caused by the following reasons: (1) the algorithm parameter constraint is too high and the algo couldn&#39;t find rules that satisfy the condition. you could try setting the following param to 0: <strong>minSupport</strong>, <strong>minConfidence</strong>, <strong>minLift</strong> and then see if anything returned (regardless of recommendation quality), and then adjust the parameter accordingly. (2) the complementary purchase engine requires buy event with correct eventTime. If you import data without specifying eventTime, the SDK will use current time because it assumes the event happens in real time (which is not the case if
  you import as batch offline), resulting in that all buy events are treated as one big transaction while they should be treated as multiple transactions.</p></div><p>The values of these parameters can be specified in <em>algorithms</em> of MyComplementaryPurchase/<strong><em>engine.json</em></strong>:</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
 4
@@ -254,7 +254,7 @@
   <span class="k">extends</span> <span class="n">P2LAlgorithm</span><span class="o">[</span><span class="kt">PreparedData</span>, <span class="kt">Model</span>, <span class="kt">Query</span>, <span class="kt">PredictedResult</span><span class="o">]</span> <span class="o">{</span>
     <span class="o">...</span>
 <span class="o">}</span>
-</pre></td></tr></tbody></table> </div> <h3 id='train(...)' class='header-anchors'>train(...)</h3><p><code>train</code> is called when you run <strong>pio train</strong> to train a predictive model. The algorithm first find all basket transcations, generates and filters the association rules based on the algorithm parameters:</p><div class="highlight scala"><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='train(...)' class='header-anchors'>train(...)</h3><p><code>train</code> is called when you run <strong>pio train</strong> to train a predictive model. The algorithm first find all basket transactions, generates and filters the association rules based on the algorithm parameters:</p><div class="highlight scala"><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/c17b9607/templates/complementarypurchase/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/complementarypurchase/quickstart/index.html b/templates/complementarypurchase/quickstart/index.html
index b967e07..4896bd2 100644
--- a/templates/complementarypurchase/quickstart/index.html
+++ b/templates/complementarypurchase/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, Complementary Purchase Engine Template supports the following entities: <strong>user</strong>, <strong>item</strong>. A user buys an item. This template requires user-buy-item events.</p><p>Note that the engine requires correct buy event time being used in order to determine if the items being bought are in the same &#39;basket&#39;, which is configured by the &#39;basketWindow&#39; parameter. Using an unreal event time for the buy events will cause an incorrect model. If you use SDK, the current time is used as event time by default.</p><div class="alert-message warning"><p>In particular, make sure correct event time is specified if you import data in batch (i.e. not in real time). If the event time is omitted, the SDK will use <strong>current time</strong> as event time which 
 is not the actual time of the buy event in this case!</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>When an user u0 buys item i0 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 buy event. Run the following <code>curl</code> command:
 </p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-1ddd62c1-70c3-402c-bd0c-8de709f36da4">REST API</a></li> <li data-lang="python"><a href="#tab-4677c753-0aa9-4ffd-a94f-8a49c1d48df8">Python SDK</a></li> <li data-lang="php"><a href="#tab-9e9f0f51-54c4-4bfe-87c1-ac67afe144bf">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-531f4729-3ddc-464d-891c-87309671ffb6">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-22bcb5d4-1c87-4501-9aef-f3b5cc1d32b6">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-1ddd62c1-70c3-402c-bd0c-8de709f36da4"> <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, Complementary Purchase Engine Template supports the following entities: <strong>user</strong>, <strong>item</strong>. A user buys an item. This template requires user-buy-item events.</p><p>Note that the engine requires correct buy event time being used in order to determine if the items being bought are in the same &#39;basket&#39;, which is configured by the &#39;basketWindow&#39; parameter. Using an unreal event time for the buy events will cause an incorrect model. If you use SDK, the current time is used as event time by default.</p><div class="alert-message warning"><p>In particular, make sure correct event time is specified if you import data in batch (i.e. not in real time). If the event time is omitted, the SDK will use <strong>current time</strong> as event time which 
 is not the actual time of the buy event in this case!</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>When an user u0 buys item i0 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 buy event. Run the following <code>curl</code> command:
 </p><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-1cd406c2-3d16-4a20-92b5-994c3e2f06f9">REST API</a></li> <li data-lang="python"><a href="#tab-51598266-3d11-4c07-b267-ff74d1155e2a">Python SDK</a></li> <li data-lang="php"><a href="#tab-d3120489-ac8a-4c94-a862-169717028ff4">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-3a3b6e8f-f4be-4617-91c7-c1b8e6623c43">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-36697a24-75b8-4b7d-8bf5-88782f7b48fe">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-1cd406c2-3d16-4a20-92b5-994c3e2f06f9"> <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
@@ -51,7 +51,7 @@ Your system is all ready to go.
   "targetEntityId" : "i0",
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-4677c753-0aa9-4ffd-a94f-8a49c1d48df8"> <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-51598266-3d11-4c07-b267-ff74d1155e2a"> <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
@@ -104,7 +104,7 @@ Your system is all ready to go.
   <span class="n">target_entity_id</span><span class="o">=&lt;</span><span class="n">ITEM</span> <span class="n">ID</span><span class="o">&gt;</span><span class="p">,</span>
   <span class="n">event_time</span><span class="o">=&lt;</span><span class="n">EVENT_TIME</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-9e9f0f51-54c4-4bfe-87c1-ac67afe144bf"> <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-d3120489-ac8a-4c94-a862-169717028ff4"> <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
@@ -155,7 +155,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-531f4729-3ddc-464d-891c-87309671ffb6"> <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-3a3b6e8f-f4be-4617-91c7-c1b8e6623c43"> <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
@@ -200,7 +200,7 @@ Your system is all ready to go.
     <span class="s1">'eventTime'</span> <span class="o">=&gt;</span> <span class="o">&lt;</span><span class="no">EVENT_TIME</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-22bcb5d4-1c87-4501-9aef-f3b5cc1d32b6"> <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-36697a24-75b8-4b7d-8bf5-88782f7b48fe"> <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
@@ -290,7 +290,7 @@ User u10 buys item s2i1 at 2014-10-19 15:43:15.618000-07:53
 </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 query the engine. For example, return top 3 items which are frequently bought with item &quot;s2i1&quot;. You can sending this JSON &#39;{ &quot;items&quot; : [&quot;s2i1&quot;], &quot;num&quot; : 3 }&#39; to the deployed engine. The engine will return a JSON with the recommeded items.</p><p>If you include one or more items in the query, the engine will use each combination of the query items as condition, and return recommended items if there is any for this condition. For example, if you query items are [&quot;A&quot;, &quot;B&qu
 ot;], then the engine will use [&quot;A&quot;], [&quot;B&quot;], and [&quot;A&quot;, &quot;B&quot;] as condition and try to find top n recommended items for each combination.</p><p>You can 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-8363ff8b-1bae-404a-b990-ba72d129eda5">REST API</a></li> <li data-lang="python"><a href="#tab-b18dc13b-fc11-4163-8ce3-919f99dc9c39">Python SDK</a></li> <li data-lang="php"><a href="#tab-a999d660-c7a0-4eef-afa5-c0c548f9d073">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-4c314941-e697-417e-9ef2-8ab45df12f59">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-0acc4930-9a61-43b1-89ce-3248f6efaca9">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-8363ff8b-1bae-4
 04a-b990-ba72d129eda5"> <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 query the engine. For example, return top 3 items which are frequently bought with item &quot;s2i1&quot;. You can sending this JSON &#39;{ &quot;items&quot; : [&quot;s2i1&quot;], &quot;num&quot; : 3 }&#39; to the deployed engine. The engine will return a JSON with the recommended items.</p><p>If you include one or more items in the query, the engine will use each combination of the query items as condition, and return recommended items if there is any for this condition. For example, if you query items are [&quot;A&quot;, &quot;B&q
 uot;], then the engine will use [&quot;A&quot;], [&quot;B&quot;], and [&quot;A&quot;, &quot;B&quot;] as condition and try to find top n recommended items for each combination.</p><p>You can 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-a97c0a9f-957b-41ac-8fa9-b000a033998d">REST API</a></li> <li data-lang="python"><a href="#tab-f2100c58-a059-4365-9dee-071a3425302f">Python SDK</a></li> <li data-lang="php"><a href="#tab-bf12d27a-b88d-4662-9768-f330ba10d55c">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-609535cf-8f86-40df-a3be-a7b299eda5d3">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-9df879b9-d04e-4fbf-b14e-5cbacdab91f1">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-a97c0a9f-957b-
 41ac-8fa9-b000a033998d"> <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
@@ -303,7 +303,7 @@ User u10 buys item s2i1 at 2014-10-19 15:43:15.618000-07:53
 }'</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-b18dc13b-fc11-4163-8ce3-919f99dc9c39"> <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-f2100c58-a059-4365-9dee-071a3425302f"> <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
@@ -314,7 +314,7 @@ http://localhost:8000/queries.json
   <span class="s">"items"</span> <span class="p">:</span> <span class="p">[</span><span class="s">"s2i1"</span><span class="p">],</span>
   <span class="s">"num"</span> <span class="p">:</span> <span class="mi">3</span>
 <span class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-a999d660-c7a0-4eef-afa5-c0c548f9d073"> <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-bf12d27a-b88d-4662-9768-f330ba10d55c"> <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
@@ -341,7 +341,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-4c314941-e697-417e-9ef2-8ab45df12f59"> <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-609535cf-8f86-40df-a3be-a7b299eda5d3"> <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
@@ -360,7 +360,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-0acc4930-9a61-43b1-89ce-3248f6efaca9"> <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-9df879b9-d04e-4fbf-b14e-5cbacdab91f1"> <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/c17b9607/templates/ecommercerecommendation/dase/index.html
----------------------------------------------------------------------
diff --git a/templates/ecommercerecommendation/dase/index.html b/templates/ecommercerecommendation/dase/index.html
index ddac180..681b9bf 100644
--- a/templates/ecommercerecommendation/dase/index.html
+++ b/templates/ecommercerecommendation/dase/index.html
@@ -361,7 +361,7 @@
   <span class="n">lambda</span><span class="k">:</span> <span class="kt">Double</span><span class="o">,</span>
   <span class="n">seed</span><span class="k">:</span> <span class="kt">Option</span><span class="o">[</span><span class="kt">Long</span><span class="o">]</span>
 <span class="o">)</span> <span class="k">extends</span> <span class="nc">Params</span>
-</pre></td></tr></tbody></table> </div> <p>Parameter description:</p> <ul> <li><strong>appName</strong>: Your App name. Events defined by &quot;seenEvents&quot; and &quot;similarEvents&quot; will be read from this app during <code>predict</code>.</li> <li><strong>unseenOnly</strong>: true or false. Set to true if you want to recommmend unseen items only. Seen items are defined by <em>seenEvents</em> which mean if the user has these events on the items, then it&#39;s treated as <em>seen</em>.</li> <li><strong>seenEvents</strong>: A list of user-to-item events which will be treated as <em>seen</em> events. Used when <em>unseenOnly</em> is set to true.</li> <li><strong>similarEvents</strong>: A list of user-item-item events which will be used to find similar items to the items which the user has performend these events on.</li> <li><strong>rank</strong>: Parameter of the MLlib ALS algorithm. Number of latent features.</li> <li><strong>numIterations</strong>: Parameter of the MLlib ALS 
 algorithm. Number of iterations.</li> <li><strong>lambda</strong>: Regularization parameter of the MLlib ALS algorithm.</li> <li><strong>seed</strong>: Optional. A random seed of the MLlib ALS algorithm. Specify a fixed value if want to have deterministic result.</li> </ul> <h3 id='train(...)' class='header-anchors'>train(...)</h3><p><code>train</code> is called when you run <strong>pio train</strong>. This is where MLlib ALS algorithm, i.e. <code>ALS.trainImplicit()</code>, is used to train a predictive model. In addition, we also count the number of items being bought for each item as default model which will be used when there is no ALS model avaiable or other useful information about the user is avaiable during <code>predict</code>.</p><div class="highlight scala"><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>Parameter description:</p> <ul> <li><strong>appName</strong>: Your App name. Events defined by &quot;seenEvents&quot; and &quot;similarEvents&quot; will be read from this app during <code>predict</code>.</li> <li><strong>unseenOnly</strong>: true or false. Set to true if you want to recommmend unseen items only. Seen items are defined by <em>seenEvents</em> which mean if the user has these events on the items, then it&#39;s treated as <em>seen</em>.</li> <li><strong>seenEvents</strong>: A list of user-to-item events which will be treated as <em>seen</em> events. Used when <em>unseenOnly</em> is set to true.</li> <li><strong>similarEvents</strong>: A list of user-item-item events which will be used to find similar items to the items which the user has performend these events on.</li> <li><strong>rank</strong>: Parameter of the MLlib ALS algorithm. Number of latent features.</li> <li><strong>numIterations</strong>: Parameter of the MLlib ALS 
 algorithm. Number of iterations.</li> <li><strong>lambda</strong>: Regularization parameter of the MLlib ALS algorithm.</li> <li><strong>seed</strong>: Optional. A random seed of the MLlib ALS algorithm. Specify a fixed value if want to have deterministic result.</li> </ul> <h3 id='train(...)' class='header-anchors'>train(...)</h3><p><code>train</code> is called when you run <strong>pio train</strong>. This is where MLlib ALS algorithm, i.e. <code>ALS.trainImplicit()</code>, is used to train a predictive model. In addition, we also count the number of items being bought for each item as default model which will be used when there is no ALS model available or other useful information about the user is available during <code>predict</code>.</p><div class="highlight scala"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4


[06/11] predictionio-site git commit: Documentation based on apache/predictionio#54415e1066ae2d646eef62ebfdf801ace1de2097

Posted by gi...@apache.org.
http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c17b9607/templates/ecommercerecommendation/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/ecommercerecommendation/quickstart/index.html b/templates/ecommercerecommendation/quickstart/index.html
index 72590a9..bc39a03 100644
--- a/templates/ecommercerecommendation/quickstart/index.html
+++ b/templates/ecommercerecommendation/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-6ebc6c8c-a995-4ef3-83f8-85cbbf14db3c">REST API</a></li> <li data-lang="python"><a href="#tab-e36d5bdc-5170-45f3-b0cc-cbb7341355a3">Python SDK</a></li> <li data-lang="php"><a href="#tab-492e5a88-3b54-422b-862f-fdd92ed0c6a1">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-2c1c5f6f-b8b5-498c-bc98-2359ef5a308d">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-d9ce4d0b-228c-4bd2-96ed-8fb6586f8f75">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-6ebc6c8c-a995-4ef3-83f8-85cbbf14db3c"> <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-48a5c936-e241-40fa-8670-06b7e6840391">REST API</a></li> <li data-lang="python"><a href="#tab-ccf88bf2-db0a-42da-985a-a6f2d162892a">Python SDK</a></li> <li data-lang="php"><a href="#tab-f3d9240a-d683-41c9-a6de-369a0e986a5b">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-de7e4cfc-1afb-4916-b216-62a376a3781e">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-f225309a-19b9-449e-b9cd-5a761b96afb8">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-48a5c936-e241-40fa-8670-06b7e6840391"> <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-e36d5bdc-5170-45f3-b0cc-cbb7341355a3"> <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-ccf88bf2-db0a-42da-985a-a6f2d162892a"> <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-492e5a88-3b54-422b-862f-fdd92ed0c6a1"> <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-f3d9240a-d683-41c9-a6de-369a0e986a5b"> <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-2c1c5f6f-b8b5-498c-bc98-2359ef5a308d"> <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-de7e4cfc-1afb-4916-b216-62a376a3781e"> <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-d9ce4d0b-228c-4bd2-96ed-8fb6586f8f75"> <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-f225309a-19b9-449e-b9cd-5a761b96afb8"> <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-b63558bd-7dc7-4c5c-9c93-f12a7a506932">REST API</a></li> <li data-lang="python"><a href="#tab-19ceeae6-fe4f-4e7e-9a08-fc5c9d8591ca">Python SDK</a></li> <li data-lang="php"><a href="#tab-7e8617df-a8b6-4a06-bfd3-4463739a0e96">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-12d513ac-1678-49a5-a830-a1f993b854d8">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-c1ff9692-320d-4963-8208-94272c108744">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-b63558
 bd-7dc7-4c5c-9c93-f12a7a506932"> <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-86e33a31-4dc4-49b1-8195-964ddb353676">REST API</a></li> <li data-lang="python"><a href="#tab-ae23f86e-bc1b-4580-bdfc-9bc50f605e98">Python SDK</a></li> <li data-lang="php"><a href="#tab-f49d409f-0fcd-4ff6-a27b-b5d4d6905b30">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-dc7049cc-f97b-4972-a9e5-020aaa1aa5e2">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-56bb4264-65c9-4044-9984-b52cbf8060ae">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-86e33a
 31-4dc4-49b1-8195-964ddb353676"> <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-19ceeae6-fe4f-4e7e-9a08-fc5c9d8591ca"> <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-ae23f86e-bc1b-4580-bdfc-9bc50f605e98"> <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-7e8617df-a8b6-4a06-bfd3-4463739a0e96"> <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-f49d409f-0fcd-4ff6-a27b-b5d4d6905b30"> <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-12d513ac-1678-49a5-a830-a1f993b854d8"> <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-dc7049cc-f97b-4972-a9e5-020aaa1aa5e2"> <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-c1ff9692-320d-4963-8208-94272c108744"> <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-56bb4264-65c9-4044-9984-b52cbf8060ae"> <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-c795f672-245e-4f93-a095-69a4511328fd">REST API</a></li> <li data-lang="python"><a href="#tab-89a3cbea-8cf8-489f-9fad-42e65c3a8df9">Python SDK</a></li> <li data-lang="php"><a href="#tab-3aad6678-55a2-4b10-b767-d5f85d728a18">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-3bcda33f-c1c4-4013-9ac5-9c3251
 0a327f">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-c376b09b-a333-4da9-9174-f62f4287f95e">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-c795f672-245e-4f93-a095-69a4511328fd"> <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-294c869f-35da-4543-9444-a2a88e3cd01c">REST API</a></li> <li data-lang="python"><a href="#tab-a1eee7be-386f-464a-9164-57632cdb1bea">Python SDK</a></li> <li data-lang="php"><a href="#tab-ba8f791f-2721-482f-895e-740987ff45a4">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-b5f045db-4316-49aa-af6e-8bbdea
 22962f">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-cffcbcd1-724b-41c7-a802-ff43e75c79fa">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-294c869f-35da-4543-9444-a2a88e3cd01c"> <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-89a3cbea-8cf8-489f-9fad-42e65c3a8df9"> <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-a1eee7be-386f-464a-9164-57632cdb1bea"> <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-3aad6678-55a2-4b10-b767-d5f85d728a18"> <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-ba8f791f-2721-482f-895e-740987ff45a4"> <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-3bcda33f-c1c4-4013-9ac5-9c32510a327f"> <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-b5f045db-4316-49aa-af6e-8bbdea22962f"> <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-c376b09b-a333-4da9-9174-f62f4287f95e"> <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-cffcbcd1-724b-41c7-a802-ff43e75c79fa"> <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-ecbbe319-53d4-41d6-a975-dd5b80670b95">REST API</a></li> <li data-lang="python"><a href="#tab-5f324582-2df1-468e-9e93-a08fba953254">Python SDK</a></li> <li data-lang="php"><a href="#tab-ac0e2034-dc6f-493b-820d-e747988c10d1">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-29a42ef2-9e4b-4f8b-a368-6d3d9e8e9eef">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-61c012e2-bcd2-471d-b319-61f002d7eb33">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-ecbbe319-53d4-41d6-a975-dd5b80670b95"> <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-6d3395f1-7e6d-441a-a9e0-e7c919b9c60d">REST API</a></li> <li data-lang="python"><a href="#tab-201b06b8-fdad-4a75-b8c9-5491542a77c3">Python SDK</a></li> <li data-lang="php"><a href="#tab-24216576-69f9-4f64-a10a-1c8b4dc8a853">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-300632cb-c40e-44ce-9ea4-4240f979e5a0">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-d7eb97d0-4815-4f6f-a623-9c2e70279318">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-6d3395f1-7e6d-441a-a9e0-e7c919b9c60d"> <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-5f324582-2df1-468e-9e93-a08fba953254"> <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-201b06b8-fdad-4a75-b8c9-5491542a77c3"> <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-ac0e2034-dc6f-493b-820d-e747988c10d1"> <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-24216576-69f9-4f64-a10a-1c8b4dc8a853"> <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-29a42ef2-9e4b-4f8b-a368-6d3d9e8e9eef"> <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-300632cb-c40e-44ce-9ea4-4240f979e5a0"> <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-61c012e2-bcd2-471d-b319-61f002d7eb33"> <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-d7eb97d0-4815-4f6f-a623-9c2e70279318"> <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;user&quot;: &quot;u1&quot;, &quot;num&quot;: 4 }</code> to the deployed engine and it will return a JSON of the recommended items. Simply send a query by making a HTTP request or through the <code>EngineClient</code> of an SDK.</p><p>With the deployed engine running, open another 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="js
 on"><a href="#tab-d7379a41-9c7f-45e5-85e1-b36b3c8d7269">REST API</a></li> <li data-lang="python"><a href="#tab-ca4a9678-52af-483b-ad26-f9b661833e48">Python SDK</a></li> <li data-lang="php"><a href="#tab-b9dc0fb0-0a5f-4f40-bdfa-913b1825110e">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-34c0b87b-d3b2-4325-94eb-e78a11f128df">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-20e23839-b5a3-4b33-8ad9-dd53bded0edc">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-d7379a41-9c7f-45e5-85e1-b36b3c8d7269"> <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;user&quot;: &quot;u1&quot;, &quot;num&quot;: 4 }</code> to the deployed engine and it will return a JSON of the recommended items. Simply send a query by making a HTTP request or through the <code>EngineClient</code> of an SDK.</p><p>With the deployed engine running, open another 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="js
 on"><a href="#tab-96e52f06-c833-434e-a05b-fde03019027f">REST API</a></li> <li data-lang="python"><a href="#tab-3b424611-38fc-4c04-857e-2fdf9105b7a3">Python SDK</a></li> <li data-lang="php"><a href="#tab-9546f2f7-e592-41a5-8d3e-f6752d509c4e">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-ebc177cd-6578-4e0c-b1ab-7ab6951cb1f1">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-28e399ce-bc4d-49dd-ad2a-83a955470b3d">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-96e52f06-c833-434e-a05b-fde03019027f"> <div class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4</pre></td> <td class="code"><pre><span class="gp">$ </span>curl -H <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
 -d <span class="s1">'{ "user": "u1", "num": 4 }'</span> <span class="se">\</span>
 http://localhost:8000/queries.json
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" data-lang="python" id="tab-ca4a9678-52af-483b-ad26-f9b661833e48"> <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-3b424611-38fc-4c04-857e-2fdf9105b7a3"> <div class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3</pre></td> <td class="code"><pre><span class="kn">import</span> <span class="nn">predictionio</span>
 <span class="n">engine_client</span> <span class="o">=</span> <span class="n">predictionio</span><span class="o">.</span><span class="n">EngineClient</span><span class="p">(</span><span class="n">url</span><span class="o">=</span><span class="s">"http://localhost:8000"</span><span class="p">)</span>
 <span class="k">print</span> <span class="n">engine_client</span><span class="o">.</span><span class="n">send_query</span><span class="p">({</span><span class="s">"user"</span><span class="p">:</span> <span class="s">"u1"</span><span class="p">,</span> <span class="s">"num"</span><span class="p">:</span> <span class="mi">4</span><span class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" data-lang="php" id="tab-b9dc0fb0-0a5f-4f40-bdfa-913b1825110e"> <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-9546f2f7-e592-41a5-8d3e-f6752d509c4e"> <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-34c0b87b-d3b2-4325-94eb-e78a11f128df"> <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-ebc177cd-6578-4e0c-b1ab-7ab6951cb1f1"> <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">'user'</span> <span class="o">=&gt;</span> <span class="s1">'i1'</span><span class="p">,</span> <span class="s1">'num'</span> <span class="o">=&gt;</span> <span class="mi">4</span><span class="p">)</span>
 
 <span class="nb">puts</span> <span class="n">response</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" data-lang="java" id="tab-20e23839-b5a3-4b33-8ad9-dd53bded0edc"> <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-28e399ce-bc4d-49dd-ad2a-83a955470b3d"> <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">"item"</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 a item contraint &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 decribed in the SDK sample above.</p></div><div class="tabs"> <ul class="control"> <li data-lang="json"><a href="#tab-66a82dab-f37a-407f-b6cc-19b42bb1de30">REST API</a></li> <li data-lang="python"><a href="#tab-756add3d-1483-4a0c-a396-c2ef5bfb40f1">Python SDK</a></li> <li data-lang="php"><a href="#tab-fa94076b-47fd-4334-9c05-c32c9f3276f8">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-cc8b3ae4-f079-4a40-8c12-0bde0941e616">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-8865f3fd-4990-410e-86f9-744b0160a583">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-66a82dab-f37a-407f-b6cc-19b42bb1de30"> <div class="highlight shell"> <table style="border-s
 pacing: 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 a item contraint &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-7a6798e1-1bcb-4444-b975-ae31351d9cfb">REST API</a></li> <li data-lang="python"><a href="#tab-1e9624a2-04be-4c8c-a44f-9df44ef0961b">Python SDK</a></li> <li data-lang="php"><a href="#tab-0f7d86e1-4d8e-4037-bdc6-7caea97b6689">PHP SDK</a></li> <li data-lang="ruby"><a href="#tab-45cd2f28-deb7-4a68-9292-d470adec52fe">Ruby SDK</a></li> <li data-lang="java"><a href="#tab-78716c2a-1ecb-43d9-a02b-e14443e7e5be">Java SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-7a6798e1-1bcb-4444-b975-ae31351d9cfb"> <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
@@ -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-756add3d-1483-4a0c-a396-c2ef5bfb40f1"> <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-1e9624a2-04be-4c8c-a44f-9df44ef0961b"> <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-fa94076b-47fd-4334-9c05-c32c9f3276f8"> <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-0f7d86e1-4d8e-4037-bdc6-7caea97b6689"> <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-cc8b3ae4-f079-4a40-8c12-0bde0941e616"> <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-45cd2f28-deb7-4a68-9292-d470adec52fe"> <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-8865f3fd-4990-410e-86f9-744b0160a583"> <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-78716c2a-1ecb-43d9-a02b-e14443e7e5be"> <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