Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 97728200B8A for ; Sat, 10 Sep 2016 00:32:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 95F82160ACE; Fri, 9 Sep 2016 22:32:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6DA33160ACA for ; Sat, 10 Sep 2016 00:32:57 +0200 (CEST) Received: (qmail 71245 invoked by uid 500); 9 Sep 2016 22:32:56 -0000 Mailing-List: contact commits-help@predictionio.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@predictionio.incubator.apache.org Delivered-To: mailing list commits@predictionio.incubator.apache.org Received: (qmail 71236 invoked by uid 99); 9 Sep 2016 22:32:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Sep 2016 22:32:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 12D7F1858B4 for ; Fri, 9 Sep 2016 22:32:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.647 X-Spam-Level: X-Spam-Status: No, score=-1.647 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, MANY_SPAN_IN_TEXT=2.999, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 1jonp_vcCgKc for ; Fri, 9 Sep 2016 22:32:46 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id ED5A65F1E9 for ; Fri, 9 Sep 2016 22:32:43 +0000 (UTC) Received: (qmail 70961 invoked by uid 99); 9 Sep 2016 22:32:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Sep 2016 22:32:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1EA87E02D4; Fri, 9 Sep 2016 22:32:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: donald@apache.org To: commits@predictionio.incubator.apache.org Date: Fri, 09 Sep 2016 22:32:44 -0000 Message-Id: <38016f8bfc8e48558853f6692129a98c@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/6] incubator-predictionio-site git commit: Based on apache/incubator-predictionio#4d646ba9085e1f5554c7f998630f5575cd7d4023 archived-at: Fri, 09 Sep 2016 22:32:59 -0000 http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/productranking/quickstart/index.html ---------------------------------------------------------------------- diff --git a/templates/productranking/quickstart/index.html b/templates/productranking/quickstart/index.html index 197223f..b890206 100644 --- a/templates/productranking/quickstart/index.html +++ b/templates/productranking/quickstart/index.html @@ -32,7 +32,7 @@ Your system is all ready to go. [INFO] [App$] MyApp1 | 1 | 3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F | (all) [INFO] [App$] MyApp2 | 2 | io5lz6Eg4m3Xe4JZTBFE13GMAf1dhFl6ZteuJfrO84XpdOz9wRCrDU44EUaYuXq5 | (all) [INFO] [App$] Finished listing 2 app(s). -

4. Collecting Data

Next, let's collect some training data for the app of this Engine. By default, the Product Ranking Engine Template supports 2 types of entities: user and item, and event view. A user can view an item. This template requires '$set' user event, '$set' item event and user-view-item events.

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 App Integration Overview for more details how to integrate your app with SDK.

Let's try sending events to EventServer with the following curl commands (The corresponding SDK code is showed in other tabs).

Replace <ACCCESS_KEY> by the Access Key generated in above steps. N ote that localhost:7070 is the default URL of the Event Server.

For convenience, set your access key to the shell variable, run:

$ ACCESS_KEY=<ACCESS_KEY>

For example, when a new user with id "u0" is created in your app on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send a $set event for this user. To send this event, run the following curl command:

1
+

4. Collecting Data

Next, let's collect some training data for the app of this Engine. By default, the Product Ranking Engine Template supports 2 types of entities: user and item, and event view. A user can view an item. This template requires '$set' user event, '$set' item event and user-view-item events.

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 App Integration Overview for more details how to integrate your app with SDK.

Let's try sending events to EventServer with the following curl commands (The corresponding SDK code is showed in other tabs).

Replace <ACCCESS_KEY> by the Access Key generated in above steps. N ote that localhost:7070 is the default URL of the Event Server.

For convenience, set your access key to the shell variable, run:

$ ACCESS_KEY=<ACCESS_KEY>

For example, when a new user with id "u0" is created in your app on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send a $set event for this user. To send this event, run the following curl command:

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"
 }'
-
1
+
1
 2
 3
 4
@@ -78,7 +78,7 @@ Your system is all ready to go.
   entity_type="user",
   entity_id=<USER_ID>
 )
-
1
+
1
 2
 3
 4
@@ -103,7 +103,7 @@ Your system is all ready to go.
   'entityId' => <USER ID>
 ));
 ?>
-
1
+
1
 2
 3
 4
@@ -120,7 +120,7 @@ Your system is all ready to go.
   'user',
   <USER ID>
 )
-
1
+
1
 2
 3
 4
@@ -145,7 +145,7 @@ Your system is all ready to go.
   .entityType("user")
   .entityId(<USER_ID>);
 client.createEvent(userEvent);
-

When a new item "i0" is created in your app on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send a $set event for the item. Run the following curl command:

When a new item "i0" is created in your app on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send a $set event for the item. Run the following curl command:

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"
 }'
-
1
+
1
 2
 3
 4
@@ -173,7 +173,7 @@ Your system is all ready to go.
   entity_type="item",
   entity_id=<ITEM_ID>
 )
-
1
+
1
 2
 3
 4
@@ -190,7 +190,7 @@ Your system is all ready to go.
 ));
 
 ?>
-
1
+
1
 2
 3
 4
@@ -203,7 +203,7 @@ Your system is all ready to go.
   <ITEM ID>
 )
 
-
1
+
1
 2
 3
 4
@@ -214,7 +214,7 @@ Your system is all ready to go.
   .entityType("item")
   .entityId(<ITEM_ID>);
 client.createEvent(itemEvent)
-

When the user "u0" view item "i0" on time 2014-11-10T12:34:56.123-08:00 (current time will be used if eventTime is not specified), you can send a view event. Run the following curl command:

When the user "u0" view item "i0" on time 2014-11-10T12:34:56.123-08:00 (current time will be used if eventTime is not specified), you can send a view event. Run the following curl command:

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"
 }'
-
1
+
1
 2
 3
 4
@@ -250,7 +250,7 @@ Your system is all ready to go.
   target_entity_type="item",
   target_entity_id=<ITEM ID>
 )
-
1
+
1
 2
 3
 4
@@ -269,7 +269,7 @@ Your system is all ready to go.
    'targetEntityId' => <ITEM ID>
 ));
 ?>
-
1
+
1
 2
 3
 4
@@ -286,7 +286,7 @@ Your system is all ready to go.
     'targetEntityId' => <ITEM ID>
   }
 )
-
1
+
1
 2
 3
 4
@@ -344,14 +344,14 @@ User u10 views item i7
 

When the engine is deployed successfully and running, you should see a console message similar to the following:

1
 2
[INFO] [HttpListener] Bound to /0.0.0.0:8000
 [INFO] [MasterActor] Bind successful. Ready to serve.
-

Do not kill the deployed engine process.

By default, the deployed engine binds to http://localhost:8000. You can visit that page in your web browser to check its status.

Engine Status

6. Use the Engine

Now, You can retrieve predicted results. To rank items with IDs "i1", "i3", "i10", "i2", "i5", "i31", "i9" for user "u2". You send this JSON { "user": "u2", "items": ["i1", "i3", "i10", "i2", "i5", "i31", "i9"] } 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 EngineCl ient of an SDK.

With the deployed engine running, open another temrinal and run the following curl command or use SDK to send the query:

1
+

Do not kill the deployed engine process.

By default, the deployed engine binds to http://localhost:8000. You can visit that page in your web browser to check its status.

Engine Status

6. Use the Engine

Now, You can retrieve predicted results. To rank items with IDs "i1", "i3", "i10", "i2", "i5", "i31", "i9" for user "u2". You send this JSON { "user": "u2", "items": ["i1", "i3", "i10", "i2", "i5", "i31", "i9"] } 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 EngineCl ient of an SDK.

With the deployed engine running, open another temrinal and run the following curl command or use SDK to send the query:

1
 2
 3
 4
$ curl -H "Content-Type: application/json" \
 -d '{ "user": "u2", "items": ["i1", "i3", "i10", "i2", "i5", "i31", "i9"]}' \
 http://localhost:8000/queries.json
 
-
1
+
1
 2
 3
 4
@@ -362,7 +362,7 @@ http://localhost:8000/queries.json
   "user": "u2",
   "items": ["i1", "i3", "i10", "i2", "i5", "i31", "i9"]
 })
-
1
+
1
 2
 3
 4
@@ -385,7 +385,7 @@ http://localhost:8000/queries.json
 print_r($response);
 
 ?>
-
1
+
1
 2
 3
 4
@@ -402,7 +402,7 @@ http://localhost:8000/queries.json
   'items' => ['i1', 'i3', 'i10', 'i2', 'i5', 'i31', 'i9'])
 
 puts response
-
1
+
1
 2
 3
 4

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/productranking/quickstart/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/productranking/quickstart/index.html.gz b/templates/productranking/quickstart/index.html.gz
index ebed5e5..16c5de4 100644
Binary files a/templates/productranking/quickstart/index.html.gz and b/templates/productranking/quickstart/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/recommendation/batch-evaluator/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/batch-evaluator/index.html.gz b/templates/recommendation/batch-evaluator/index.html.gz
index 37583ed..afa4586 100644
Binary files a/templates/recommendation/batch-evaluator/index.html.gz and b/templates/recommendation/batch-evaluator/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/recommendation/blacklist-items/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/blacklist-items/index.html.gz b/templates/recommendation/blacklist-items/index.html.gz
index d551a42..77b3c96 100644
Binary files a/templates/recommendation/blacklist-items/index.html.gz and b/templates/recommendation/blacklist-items/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/recommendation/customize-data-prep/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/customize-data-prep/index.html.gz b/templates/recommendation/customize-data-prep/index.html.gz
index fcb1629..4339dd7 100644
Binary files a/templates/recommendation/customize-data-prep/index.html.gz and b/templates/recommendation/customize-data-prep/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/recommendation/customize-serving/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/customize-serving/index.html.gz b/templates/recommendation/customize-serving/index.html.gz
index 10ccffe..0581354 100644
Binary files a/templates/recommendation/customize-serving/index.html.gz and b/templates/recommendation/customize-serving/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/recommendation/dase/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/dase/index.html.gz b/templates/recommendation/dase/index.html.gz
index b15950e..27e2275 100644
Binary files a/templates/recommendation/dase/index.html.gz and b/templates/recommendation/dase/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/recommendation/evaluation/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/evaluation/index.html.gz b/templates/recommendation/evaluation/index.html.gz
index f835909..8079995 100644
Binary files a/templates/recommendation/evaluation/index.html.gz and b/templates/recommendation/evaluation/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/recommendation/how-to/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/how-to/index.html.gz b/templates/recommendation/how-to/index.html.gz
index eaad548..f94a6cc 100644
Binary files a/templates/recommendation/how-to/index.html.gz and b/templates/recommendation/how-to/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/recommendation/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/recommendation/quickstart/index.html b/templates/recommendation/quickstart/index.html
index 8a2d5ed..24e3b8e 100644
--- a/templates/recommendation/quickstart/index.html
+++ b/templates/recommendation/quickstart/index.html
@@ -32,7 +32,7 @@ Your system is all ready to go.
 [INFO] [App$]               MyApp1 |    1 | 3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F | (all)
 [INFO] [App$]               MyApp2 |    2 | io5lz6Eg4m3Xe4JZTBFE13GMAf1dhFl6ZteuJfrO84XpdOz9wRCrDU44EUaYuXq5 | (all)
 [INFO] [App$] Finished listing 2 app(s).
-

4. Collecting Data

Next, let's collect some training data. By default, the Recommendation Engine Template supports 2 types of events: rate and buy. A user can give a rating score to an item or he can buy an item. This template requires user-view-item and user-buy-item events.

This template can easily be customized to consider more user events such as like, dislike etc.

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 App Integration Overview for more details how to integrate your app with SDK.

Let's try sending events to EventServer with the following curl commands (The corresponding SDK code is showed in other tabs) .

Replace <ACCCESS_KEY> by the Access Key generated in above steps. Note that localhost:7070 is the default URL of the Event Server.

For convenience, set your access key to the shell variable, run:

$ ACCESS_KEY=<ACCESS_KEY>

For example, when a user with ID "u0" rate an item with ID "i0" with rating of 5 on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send the following "rate" event. Run the following curl command:

1
+

4. Collecting Data

Next, let's collect some training data. By default, the Recommendation Engine Template supports 2 types of events: rate and buy. A user can give a rating score to an item or he can buy an item. This template requires user-view-item and user-buy-item events.

This template can easily be customized to consider more user events such as like, dislike etc.

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 App Integration Overview for more details how to integrate your app with SDK.

Let's try sending events to EventServer with the following curl commands (The corresponding SDK code is showed in other tabs) .

Replace <ACCCESS_KEY> by the Access Key generated in above steps. Note that localhost:7070 is the default URL of the Event Server.

For convenience, set your access key to the shell variable, run:

$ ACCESS_KEY=<ACCESS_KEY>

For example, when a user with ID "u0" rate an item with ID "i0" with rating of 5 on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send the following "rate" event. Run the following curl command:

1
 2
 3
 4
@@ -57,7 +57,7 @@ Your system is all ready to go.
   }
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'
-
1
+
1
 2
 3
 4
@@ -92,7 +92,7 @@ Your system is all ready to go.
     target_entity_id=<ITEM ID>,
     properties= { "rating" : float(<RATING>) }
 )
-
1
+
1
 2
 3
 4
@@ -123,7 +123,7 @@ Your system is all ready to go.
    'properties' => array('rating'=> <RATING>)
 ));
 ?>
-
1
+
1
 2
 3
 4
@@ -150,7 +150,7 @@ Your system is all ready to go.
   }
 )
 
-
1
+
1
 2
 3
 4
@@ -179,7 +179,7 @@ Your system is all ready to go.
     .property("rating", new Float(<RATING>));
 client.createEvent(rateEvent);
 
-

When a user with ID "u1" buy an item with ID "i2" on time 2014-11-10T12:34:56.123-08:00 (current time will be used if eventTime is not specified), you can send the following "rate" event. Run the following curl command:

When a user with ID "u1" buy an item with ID "i2" on time 2014-11-10T12:34:56.123-08:00 (current time will be used if eventTime is not specified), you can send the following "rate" event. Run the following curl command:

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"
 }'
-
1
+
1
 2
 3
 4
@@ -213,7 +213,7 @@ Your system is all ready to go.
     target_entity_type="item",
     target_entity_id=<ITEM ID>
 )
-
1
+
1
 2
 3
 4
@@ -232,7 +232,7 @@ Your system is all ready to go.
    'targetEntityId' => <ITEM ID>
 ));
 ?>
-
1
+
1
 2
 3
 4
@@ -249,7 +249,7 @@ Your system is all ready to go.
     'targetEntityId' => <ITEM ID>
   }
 )
-
1
+
1
 2
 3
 4
@@ -297,17 +297,17 @@ Your system is all ready to go.
 

When the engine is deployed successfully and running, you should see a console message similar to the following:

1
 2
[INFO] [HttpListener] Bound to /0.0.0.0:8000
 [INFO] [MasterActor] Bind successful. Ready to serve.
-

Do not kill the deployed engine process.

By default, the deployed engine binds to http://localhost:8000. You can visit that page in your web browser to check its status.

Engine Status

6. Use the Engine

Now, You can try to retrieve predicted results. To recommend 4 movies to user whose id is 1, you send this JSON { "user": "1", "num": 4 } 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 EngineClient of an SDK.

With the deployed engine running, open another temrinal and run the following curl command or use SDK to send the query:

1
+

Do not kill the deployed engine process.

By default, the deployed engine binds to http://localhost:8000. You can visit that page in your web browser to check its status.

Engine Status

6. Use the Engine

Now, You can try to retrieve predicted results. To recommend 4 movies to user whose id is 1, you send this JSON { "user": "1", "num": 4 } 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 EngineClient of an SDK.

With the deployed engine running, open another temrinal and run the following curl command or use SDK to send the query:

1
 2
 3
$ curl -H "Content-Type: application/json" \
 -d '{ "user": "1", "num": 4 }' http://localhost:8000/queries.json
 
-
1
+
1
 2
 3
import predictionio
 engine_client = predictionio.EngineClient(url="http://localhost:8000")
 print engine_client.send_query({"user": "1", "num": 4})
-
1
+
1
 2
 3
 4
@@ -326,7 +326,7 @@ Your system is all ready to go.
 print_r($response);
 
 ?>
-
1
+
1
 2
 3
 4
@@ -339,7 +339,7 @@ Your system is all ready to go.
 response = client.send_query('user' => <USER ID>, 'num' => <NUMBER (integer)>)
 
 puts response
-
1
+
1
 2
 3
 4

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/recommendation/quickstart/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/quickstart/index.html.gz b/templates/recommendation/quickstart/index.html.gz
index 4c509a4..b4fd2fc 100644
Binary files a/templates/recommendation/quickstart/index.html.gz and b/templates/recommendation/quickstart/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/recommendation/reading-custom-events/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/reading-custom-events/index.html.gz b/templates/recommendation/reading-custom-events/index.html.gz
index 50c4b3b..5dc8f94 100644
Binary files a/templates/recommendation/reading-custom-events/index.html.gz and b/templates/recommendation/reading-custom-events/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/recommendation/training-with-implicit-preference/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/training-with-implicit-preference/index.html.gz b/templates/recommendation/training-with-implicit-preference/index.html.gz
index 0ef201b..92b10c8 100644
Binary files a/templates/recommendation/training-with-implicit-preference/index.html.gz and b/templates/recommendation/training-with-implicit-preference/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/similarproduct/dase/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/similarproduct/dase/index.html.gz b/templates/similarproduct/dase/index.html.gz
index 1775cb2..28a8e1c 100644
Binary files a/templates/similarproduct/dase/index.html.gz and b/templates/similarproduct/dase/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/similarproduct/how-to/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/similarproduct/how-to/index.html.gz b/templates/similarproduct/how-to/index.html.gz
index bc114cd..4041740 100644
Binary files a/templates/similarproduct/how-to/index.html.gz and b/templates/similarproduct/how-to/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/similarproduct/multi-events-multi-algos/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/similarproduct/multi-events-multi-algos/index.html.gz b/templates/similarproduct/multi-events-multi-algos/index.html.gz
index 72f1fa3..a1f134a 100644
Binary files a/templates/similarproduct/multi-events-multi-algos/index.html.gz and b/templates/similarproduct/multi-events-multi-algos/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/f6e61ed2/templates/similarproduct/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/similarproduct/quickstart/index.html b/templates/similarproduct/quickstart/index.html
index d6cc113..8409c30 100644
--- a/templates/similarproduct/quickstart/index.html
+++ b/templates/similarproduct/quickstart/index.html
@@ -32,7 +32,7 @@ Your system is all ready to go.
 [INFO] [App$]               MyApp1 |    1 | 3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F | (all)
 [INFO] [App$]               MyApp2 |    2 | io5lz6Eg4m3Xe4JZTBFE13GMAf1dhFl6ZteuJfrO84XpdOz9wRCrDU44EUaYuXq5 | (all)
 [INFO] [App$] Finished listing 2 app(s).
-

4. Collecting Data

Next, let's collect some training data for the app of this Engine. By default, the Similar Product Engine Template supports 2 types of entities: user and item, and event view. An item has the categories property, which is a list of category names (String). A user can view an item. Respectively, this template requires '$set' user event, '$set' item event, and user-view-item events.

This template can easily be customized to consider more user events such as buy, rate and like.

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 App Integration Overview for more detail s how to integrate your app with SDK.

Let's try sending events to EventServer with the following curl commands (The corresponding SDK code is showed in other tabs).

Replace <ACCCESS_KEY> by the Access Key generated in above steps. Note that localhost:7070 is the default URL of the Event Server.

For convenience, set your access key to the shell variable, run:

$ ACCESS_KEY=<ACCESS_KEY>

For example, when a new user with id "u0" is created in your app on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send a $set event for this user. To send this event, run the following curl command:

1
+

4. Collecting Data

Next, let's collect some training data for the app of this Engine. By default, the Similar Product Engine Template supports 2 types of entities: user and item, and event view. An item has the categories property, which is a list of category names (String). A user can view an item. Respectively, this template requires '$set' user event, '$set' item event, and user-view-item events.

This template can easily be customized to consider more user events such as buy, rate and like.

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 App Integration Overview for more detail s how to integrate your app with SDK.

Let's try sending events to EventServer with the following curl commands (The corresponding SDK code is showed in other tabs).

Replace <ACCCESS_KEY> by the Access Key generated in above steps. Note that localhost:7070 is the default URL of the Event Server.

For convenience, set your access key to the shell variable, run:

$ ACCESS_KEY=<ACCESS_KEY>

For example, when a new user with id "u0" is created in your app on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send a $set event for this user. To send this event, run the following curl command:

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"
 }'
-
1
+
1
 2
 3
 4
@@ -86,7 +86,7 @@ Your system is all ready to go.
   event_time=datetime(
     2014, 11, 02, 09, 39, 45, 618000, pytz.timezone('US/Pacific')
 )
-
1
+
1
 2
 3
 4
@@ -111,7 +111,7 @@ Your system is all ready to go.
   'entityId' => <USER ID>
 ));
 ?>
-
1
+
1
 2
 3
 4
@@ -128,7 +128,7 @@ Your system is all ready to go.
   'user',
   <USER ID>
 )
-
1
+
1
 2
 3
 4
@@ -153,7 +153,7 @@ Your system is all ready to go.
   .entityType("user")
   .entityId(<USER_ID>);
 client.createEvent(userEvent);
-

When a new item "i0" is created in your app on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send a $set event for the item. Note that the item is set with categories properties: "c1" and "c2". Run the following curl command:

When a new item "i0" is created in your app on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send a $set event for the item. Note that the item is set with categories properties: "c1" and "c2". Run the following curl command:

1
 2
 3
 4
@@ -174,7 +174,7 @@ Your system is all ready to go.
   }
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'
-
1
+
1
 2
 3
 4
@@ -193,7 +193,7 @@ Your system is all ready to go.
     "categories" : ["<CATEGORY_1>", "<CATEGORY_2>"]
   }
 )
-
1
+
1
 2
 3
 4
@@ -214,7 +214,7 @@ Your system is all ready to go.
 ));
 
 ?>
-
1
+
1
 2
 3
 4
@@ -231,7 +231,7 @@ Your system is all ready to go.
   }
 )
 
-
1
+
1
 2
 3
 4
@@ -244,7 +244,7 @@ Your system is all ready to go.
   .entityId(<ITEM_ID>)
   .property("categories", ImmutableList.of("<CATEGORY_1>", "<CATEGORY_2>"));
 client.createEvent(itemEvent)
-

When the user "u0" view item "i0" on time 2014-11-10T12:34:56.123-08:00 (current time will be used if eventTime is not specified), you can send a view event. Run the following curl command:

When the user "u0" view item "i0" on time 2014-11-10T12:34:56.123-08:00 (current time will be used if eventTime is not specified), you can send a view event. Run the following curl command:

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"
 }'
-
1
+
1
 2
 3
 4
@@ -280,7 +280,7 @@ Your system is all ready to go.
   target_entity_type="item",
   target_entity_id=<ITEM ID>
 )
-
1
+
1
 2
 3
 4
@@ -299,7 +299,7 @@ Your system is all ready to go.
    'targetEntityId' => <ITEM ID>
 ));
 ?>
-
1
+
1
 2
 3
 4
@@ -316,7 +316,7 @@ Your system is all ready to go.
     'targetEntityId' => <ITEM ID>
   }
 )
-
1
+
1
 2
 3
 4
@@ -376,19 +376,19 @@ User u10 views item i29
 

When the engine is deployed successfully and running, you should see a console message similar to the following:

1
 2
[INFO] [HttpListener] Bound to /0.0.0.0:8000
 [INFO] [MasterActor] Bind successful. Ready to serve.
-

Do not kill the deployed engine process.

By default, the deployed engine binds to http://localhost:8000. You can visit that page in your web browser to check its status.

Engine Status

6. Use the Engine

Now, You can retrieve predicted results. To retrieve 4 items which are similar to item ID "i1". You send this JSON { "items": ["i1"], "num": 4 } 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 EngineClient of an SDK.

With the deployed engine running, open another temrinal and run the following curl command or use SDK to send the query:

1
+

Do not kill the deployed engine process.

By default, the deployed engine binds to http://localhost:8000. You can visit that page in your web browser to check its status.

Engine Status

6. Use the Engine

Now, You can retrieve predicted results. To retrieve 4 items which are similar to item ID "i1". You send this JSON { "items": ["i1"], "num": 4 } 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 EngineClient of an SDK.

With the deployed engine running, open another temrinal and run the following curl command or use SDK to send the query:

1
 2
 3
 4
$ curl -H "Content-Type: application/json" \
 -d '{ "items": ["i1"], "num": 4 }' \
 http://localhost:8000/queries.json
 
-
1
+
1
 2
 3
import predictionio
 engine_client = predictionio.EngineClient(url="http://localhost:8000")
 print engine_client.send_query({"items": ["i1"], "num": 4})
-
1
+
1
 2
 3
 4
@@ -407,7 +407,7 @@ http://localhost:8000/queries.json
 print_r($response);
 
 ?>
-
1
+
1
 2
 3
 4
@@ -420,7 +420,7 @@ http://localhost:8000/queries.json
 response = client.send_query('items' => ['i1'], 'num' => 4)
 
 puts response
-
1
+
1
 2
 3
 4