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 B31A5200D2B for ; Thu, 19 Oct 2017 04:26:42 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B19EF160BEC; Thu, 19 Oct 2017 02:26:42 +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 125D5160BEA for ; Thu, 19 Oct 2017 04:26:40 +0200 (CEST) Received: (qmail 58863 invoked by uid 500); 19 Oct 2017 02:26:40 -0000 Mailing-List: contact commits-help@predictionio.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@predictionio.apache.org Delivered-To: mailing list commits@predictionio.apache.org Received: (qmail 58854 invoked by uid 99); 19 Oct 2017 02:26:40 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Oct 2017 02:26:40 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 50174C32F0 for ; Thu, 19 Oct 2017 02:26:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -2.722 X-Spam-Level: X-Spam-Status: No, score=-2.722 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_NUMSUBJECT=0.5, MANY_SPAN_IN_TEXT=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 6gOSb-U9vCJX for ; Thu, 19 Oct 2017 02:26:35 +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 A4F6060CE6 for ; Thu, 19 Oct 2017 02:26:26 +0000 (UTC) Received: (qmail 58577 invoked by uid 99); 19 Oct 2017 02:26:25 -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; Thu, 19 Oct 2017 02:26:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AA345DFCB7; Thu, 19 Oct 2017 02:26:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: git-site-role@apache.org To: commits@predictionio.incubator.apache.org Date: Thu, 19 Oct 2017 02:26:28 -0000 Message-Id: <6be5ef81ee0542cd86d699faa8b4863f@git.apache.org> In-Reply-To: <4c019dc347ab434c88775e5d1c41187f@git.apache.org> References: <4c019dc347ab434c88775e5d1c41187f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [5/9] incubator-predictionio-site git commit: Documentation based on apache/incubator-predictionio#f9a1dc26d891d0b9d04dca4571fdfe9cbea0fc14 archived-at: Thu, 19 Oct 2017 02:26:42 -0000 http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/system/anotherdatastore/index.html.gz ---------------------------------------------------------------------- diff --git a/system/anotherdatastore/index.html.gz b/system/anotherdatastore/index.html.gz index 267c039..a385de6 100644 Binary files a/system/anotherdatastore/index.html.gz and b/system/anotherdatastore/index.html.gz differ http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/system/deploy-cloudformation/index.html.gz ---------------------------------------------------------------------- diff --git a/system/deploy-cloudformation/index.html.gz b/system/deploy-cloudformation/index.html.gz index 8ed4fde..2f8121f 100644 Binary files a/system/deploy-cloudformation/index.html.gz and b/system/deploy-cloudformation/index.html.gz differ http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/system/index.html.gz ---------------------------------------------------------------------- diff --git a/system/index.html.gz b/system/index.html.gz index ba45587..e228486 100644 Binary files a/system/index.html.gz and b/system/index.html.gz differ http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/templates/classification/add-algorithm/index.html.gz ---------------------------------------------------------------------- diff --git a/templates/classification/add-algorithm/index.html.gz b/templates/classification/add-algorithm/index.html.gz index dd0a1e7..b38e585 100644 Binary files a/templates/classification/add-algorithm/index.html.gz and b/templates/classification/add-algorithm/index.html.gz differ http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/templates/classification/dase/index.html.gz ---------------------------------------------------------------------- diff --git a/templates/classification/dase/index.html.gz b/templates/classification/dase/index.html.gz index 950b372..3f628d6 100644 Binary files a/templates/classification/dase/index.html.gz and b/templates/classification/dase/index.html.gz differ http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/templates/classification/how-to/index.html.gz ---------------------------------------------------------------------- diff --git a/templates/classification/how-to/index.html.gz b/templates/classification/how-to/index.html.gz index 1ece9e7..fcf02f7 100644 Binary files a/templates/classification/how-to/index.html.gz and b/templates/classification/how-to/index.html.gz differ http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/templates/classification/quickstart/index.html ---------------------------------------------------------------------- diff --git a/templates/classification/quickstart/index.html b/templates/classification/quickstart/index.html index 1ee1bdc..3d1b3fc 100644 --- a/templates/classification/quickstart/index.html +++ b/templates/classification/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 Classification Engine Template reads 4 properties of a user record: attr0, attr1, attr2 and plan. This templates requires '$set' user events.

This template can easily be customized to use different or more number of attributes.

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 loc alhost:7070 is the default URL of the Event Server.

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

$ ACCESS_KEY=<ACCESS_KEY>

To set properties "attr0", "attr1", "attr2" and "plan" for user "u0" on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send $set event for the user. To send this event, run the following curl command:

1
+

4. Collecting Data

Next, let'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 '$set' user events.

This template can easily be customized to use different or more number of attributes.

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 loc alhost:7070 is the default URL of the Event Server.

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

$ ACCESS_KEY=<ACCESS_KEY>

To set properties "attr0", "attr1", "attr2" and "plan" for user "u0" on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send $set event for the user. To send this event, run the following curl command:

1
 2
 3
 4
@@ -59,7 +59,7 @@ Your system is all ready to go.
   }
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'
-
1
+
1
 2
 3
 4
@@ -100,7 +100,7 @@ Your system is all ready to go.
       "plan" : int(<VALUE OF PLAN>)
     }
 )
-
1
+
1
 2
 3
 4
@@ -137,7 +137,7 @@ Your system is all ready to go.
    )
 ));
 ?>
-
1
+
1
 2
 3
 4
@@ -168,7 +168,7 @@ Your system is all ready to go.
     }
   }
 )
-
1
+
1
 2
 3
 4
@@ -203,7 +203,7 @@ Your system is all ready to go.
         "plan", <VALUE OF PLAN>
     ));
 client.createEvent(event);
-

Note that you can also set the properties for the user with multiple $set events (They will be aggregated during engine training).

To set properties "attr0", "attr1" and "attr2", and "plan" for user "u1" at different time, you can send follwing $set events for the user. To send these events, run the following curl command:

Note that you can also set the properties for the user with multiple $set events (They will be aggregated during engine training).

To set properties "attr0", "attr1" and "attr2", and "plan" for user "u1" at different time, you can send follwing $set events for the user. To send these events, run the following curl command:

1
 2
 3
 4
@@ -274,7 +274,7 @@ Your system is all ready to go.
   }
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'
-
1
+
1
 2
 3
 4
@@ -327,7 +327,7 @@ Your system is all ready to go.
       "plan" : int(<VALUE OF PLAN>)
     }
 )
-
1
+
1
 2
 3
 4
@@ -390,7 +390,7 @@ Your system is all ready to go.
 ));
 
 ?>
-
1
+
1
 2
 3
 4
@@ -433,7 +433,7 @@ Your system is all ready to go.
 )
 
 # Etc...
-
1
+
1
 2
 3
 4
@@ -497,17 +497,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. For example, to predict the label (i.e. plan in this case) of a user with attr0=2, attr1=0 and attr2=0, you send this JSON { "attr0":2, "attr1":0, "attr2":0 } 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 EngineClient of an SDK.

With the deployed engine running, open another terminal and run the following curl command or use SDK t o 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. For example, to predict the label (i.e. plan in this case) of a user with attr0=2, attr1=0 and attr2=0, you send this JSON { "attr0":2, "attr1":0, "attr2":0 } 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 EngineClient of an SDK.

With the deployed engine running, open another terminal and run the following curl command or use SDK t o send the query:

1
 2
 3
$ curl -H "Content-Type: application/json" \
 -d '{ "attr0":2, "attr1":0, "attr2":0 }' http://localhost:8000/queries.json
 
-
1
+
1
 2
 3
import predictionio
 engine_client = predictionio.EngineClient(url="http://localhost:8000")
 print engine_client.send_query({"attr0":2, "attr1":0, "attr2":0})
-
1
+
1
 2
 3
 4
@@ -526,7 +526,7 @@ Your system is all ready to go.
 print_r($response);
 
 ?>
-
1
+
1
 2
 3
 4
@@ -539,7 +539,7 @@ Your system is all ready to go.
 response = client.send_query('attr0' => 2, 'attr1' => 0, 'attr2' => 0)
 
 puts response
-
1
+
1
 2
 3
 4

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/templates/classification/quickstart/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/classification/quickstart/index.html.gz b/templates/classification/quickstart/index.html.gz
index 34d0e26..d344775 100644
Binary files a/templates/classification/quickstart/index.html.gz and b/templates/classification/quickstart/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/templates/classification/reading-custom-properties/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/classification/reading-custom-properties/index.html.gz b/templates/classification/reading-custom-properties/index.html.gz
index 6fe21e9..190d7ea 100644
Binary files a/templates/classification/reading-custom-properties/index.html.gz and b/templates/classification/reading-custom-properties/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/templates/complementarypurchase/dase/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/complementarypurchase/dase/index.html.gz b/templates/complementarypurchase/dase/index.html.gz
index 80931a4..b3120ce 100644
Binary files a/templates/complementarypurchase/dase/index.html.gz and b/templates/complementarypurchase/dase/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/templates/complementarypurchase/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/complementarypurchase/quickstart/index.html b/templates/complementarypurchase/quickstart/index.html
index 248fe42..840f88f 100644
--- a/templates/complementarypurchase/quickstart/index.html
+++ b/templates/complementarypurchase/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 training data for this Engine. By default, Complementary Purchase Engine Template supports the following entities: user, item. A user buys an item. This template requires user-buy-item events.

Note that the engine requires correct buy event time being used in order to determine if the items being bought are in the same 'basket', which is configured by the 'basketWindow' 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.

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 current time as event time which is not the actual time of the buy event in this case!

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>

When an user u0 buys item i0 on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send a buy event. Run the following curl command:

1
+

4. Collecting Data

Next, let's collect training data for this Engine. By default, Complementary Purchase Engine Template supports the following entities: user, item. A user buys an item. This template requires user-buy-item events.

Note that the engine requires correct buy event time being used in order to determine if the items being bought are in the same 'basket', which is configured by the 'basketWindow' 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.

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 current time as event time which is not the actual time of the buy event in this case!

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>

When an user u0 buys item i0 on time 2014-11-02T09:39:45.618-08:00 (current time will be used if eventTime is not specified), you can send a buy event. Run the following curl command:

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"
 }'
-
1
+
1
 2
 3
 4
@@ -104,7 +104,7 @@ Your system is all ready to go.
   target_entity_id=<ITEM ID>,
   event_time=<EVENT_TIME>
 )
-
1
+
1
 2
 3
 4
@@ -155,7 +155,7 @@ Your system is all ready to go.
 ));
 
 ?>
-
1
+
1
 2
 3
 4
@@ -200,7 +200,7 @@ Your system is all ready to go.
     'eventTime' => <EVENT_TIME>
   }
 )
-
1
+
1
 2
 3
 4
@@ -290,7 +290,7 @@ User u10 buys item s2i1 at 2014-10-19 15:43:15.618000-07:53
 

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 query the engine. For example, return top 3 items which are frequently bought with item "s2i1". You can sending this JSON '{ "items" : ["s2i1"], "num" : 3 }' to the deployed engine. The engine will return a JSON with the recommeded items.

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 ["A", "B&qu ot;], then the engine will use ["A"], ["B"], and ["A", "B"] as condition and try to find top n recommended items for each combination.

You can simply send a query by making a HTTP request or through the EngineClient of an SDK.

With the deployed engine running, open another terminal 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 query the engine. For example, return top 3 items which are frequently bought with item "s2i1". You can sending this JSON '{ "items" : ["s2i1"], "num" : 3 }' to the deployed engine. The engine will return a JSON with the recommeded items.

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 ["A", "B&qu ot;], then the engine will use ["A"], ["B"], and ["A", "B"] as condition and try to find top n recommended items for each combination.

You can simply send a query by making a HTTP request or through the EngineClient of an SDK.

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

1
 2
 3
 4
@@ -303,7 +303,7 @@ User u10 buys item s2i1 at 2014-10-19 15:43:15.618000-07:53
 }' \
 http://localhost:8000/queries.json
 
-
1
+
1
 2
 3
 4
@@ -314,7 +314,7 @@ http://localhost:8000/queries.json
   "items" : ["s2i1"],
   "num" : 3
 })
-
1
+
1
 2
 3
 4
@@ -341,7 +341,7 @@ http://localhost:8000/queries.json
 print_r($response);
 
 ?>
-
1
+
1
 2
 3
 4
@@ -360,7 +360,7 @@ http://localhost:8000/queries.json
 )
 
 puts response
-
1
+
1
 2
 3
 4

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/templates/complementarypurchase/quickstart/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/complementarypurchase/quickstart/index.html.gz b/templates/complementarypurchase/quickstart/index.html.gz
index 911e439..18ca607 100644
Binary files a/templates/complementarypurchase/quickstart/index.html.gz and b/templates/complementarypurchase/quickstart/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/templates/ecommercerecommendation/adjust-score/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/ecommercerecommendation/adjust-score/index.html.gz b/templates/ecommercerecommendation/adjust-score/index.html.gz
index 7dc6790..024048b 100644
Binary files a/templates/ecommercerecommendation/adjust-score/index.html.gz and b/templates/ecommercerecommendation/adjust-score/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/templates/ecommercerecommendation/dase/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/ecommercerecommendation/dase/index.html.gz b/templates/ecommercerecommendation/dase/index.html.gz
index 3d9ec40..4f94419 100644
Binary files a/templates/ecommercerecommendation/dase/index.html.gz and b/templates/ecommercerecommendation/dase/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/a8b9a7b1/templates/ecommercerecommendation/how-to/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/ecommercerecommendation/how-to/index.html.gz b/templates/ecommercerecommendation/how-to/index.html.gz
index 0160e24..46bdd20 100644
Binary files a/templates/ecommercerecommendation/how-to/index.html.gz and b/templates/ecommercerecommendation/how-to/index.html.gz differ