introduce to predictionio
TRANSCRIPT
ML as a ServicesIntegrate everything of ML together nicely and move from prototyping to production
10
PredcitonIO Open Source
§ open source framework§ for developers and data
scientists§ querying via restful API
Machine Learning
§ event collection§ algorithms deployment§ evaluation
11
Prerequisites § Apache Hadoop 2.4.0§ Apache Spark 1.3.0 for Hadoop 2.4§ Java SE Development Kit 7§ MySQL 5.1
17
Installation
§ Quick Install
§ status
12$ bash -c "$(curl -s https://install.prediction.io/install.sh)"$ PATH=$PATH:/home/yourname/PredictionIO/bin; export PATH
12345
$ pio status
### Return:…[INFO] [Console$] Your system is all ready to go.18
Step 2
§ Create a new Engine from an Engine Template
use Universal Recommender for example
1 $ pio template get <template-repo-path> ./<your-app-directory>
21
Step 3
§ Generate an App ID and Access Key1234567
$ cd MyRecommendation$ pio app new MyRecommendation
### Return:…[INFO] [App$] ID: 1 [INFO] [App$] Access Key: ...
22
Step 4
§ Collecting Data
§ Sample Data
12$ curl <sample_data> --create-dirs -o data/<sample_data>$ python data/import_eventserver.py --access_key <access-key>
./data/<sample_data>1234
0::2::30::3::13::9::46::9::1
23
Step 5
§ Deploy the Engine as a Service./Engine.json1234567
… "datasource": {"params" : {
"appName": MyRecommendation}
},…
24
Step 5
§ Bulid and Training the Predictive Model123456789
$ pio build### Return:…[INFO] [Console$] Your engine is ready for training.
$ pio train### Return:…[INFO] [CoreWorkflow$] Training completed successfully.25
Step 5
§ Bulid and Training the Predictive Model12345
$ pio deploy### Return:…[INFO] [HttpListener] Bound to /0.0.0.0:8000 [INFO] [MasterActor] Bind successful. Ready to serve.
26
Step 6
§ Use the Engine123456789
$ curl -d '{ "user": "1", "num": 2 }'/ http://localhost:8000/queries.json
### Return:{ "itemScores”: [
{ "item":"22", "score":4.072304374729956},{ "item":"62", "score":4.058482414005789},
]}27