tag | 2b768492558c590ff25a063763471c7139748f1d | |
---|---|---|
tagger | Donald Szeto <dszeto@salesforce.com> | Thu May 04 08:53:34 2017 -0700 |
object | 1d0d71dc372446dcd49400ed280d5a7b5f2f2860 |
v0.11.0-incubating
commit | 1d0d71dc372446dcd49400ed280d5a7b5f2f2860 | [log] [tgz] |
---|---|---|
author | Donald Szeto <dszeto@salesforce.com> | Thu May 04 08:53:12 2017 -0700 |
committer | Donald Szeto <dszeto@salesforce.com> | Thu May 04 08:53:12 2017 -0700 |
tree | ef84462d12293de17c2ae603a3a300f71aa25ac4 | |
parent | 93abf81ff35d28d1a4586f2aacb74a475f18b23b [diff] |
0.11.0-incubating release
Please refer to http://predictionio.incubator.apache.org/templates/ecommercerecommendation/quickstart/
Change from ALSAlgorithm.scala to ECommAlgorithm.scala
add some unit tests for testing code that may be customized
update for PredictionIO 0.9.2, including:
$ python data/import_eventserver.py --access_key <your_access_key>
normal:
$ curl -H "Content-Type: application/json" \ -d '{ "user" : "u1", "num" : 10 }' \ http://localhost:8000/queries.json \ -w %{time_connect}:%{time_starttransfer}:%{time_total}
$ curl -H "Content-Type: application/json" \ -d '{ "user" : "u1", "num": 10, "categories" : ["c4", "c3"] }' \ http://localhost:8000/queries.json \ -w %{time_connect}:%{time_starttransfer}:%{time_total}
curl -H "Content-Type: application/json" \ -d '{ "user" : "u1", "num": 10, "whiteList": ["i21", "i26", "i40"] }' \ http://localhost:8000/queries.json \ -w %{time_connect}:%{time_starttransfer}:%{time_total}
curl -H "Content-Type: application/json" \ -d '{ "user" : "u1", "num": 10, "blackList": ["i21", "i26", "i40"] }' \ http://localhost:8000/queries.json \ -w %{time_connect}:%{time_starttransfer}:%{time_total}
unknown user:
curl -H "Content-Type: application/json" \ -d '{ "user" : "unk1", "num": 10}' \ http://localhost:8000/queries.json \ -w %{time_connect}:%{time_starttransfer}:%{time_total}
new user:
curl -H "Content-Type: application/json" \ -d '{ "user" : "x1", "num": 10}' \ http://localhost:8000/queries.json \ -w %{time_connect}:%{time_starttransfer}:%{time_total}
import some view events and try to get recommendation for x1 again.
accessKey=<YOUR_ACCESS_KEY>
curl -i -X POST http://localhost:7070/events.json?accessKey=$accessKey \ -H "Content-Type: application/json" \ -d '{ "event" : "view", "entityType" : "user" "entityId" : "x1", "targetEntityType" : "item", "targetEntityId" : "i2", "eventTime" : "2015-02-17T02:11:21.934Z" }' curl -i -X POST http://localhost:7070/events.json?accessKey=$accessKey \ -H "Content-Type: application/json" \ -d '{ "event" : "view", "entityType" : "user" "entityId" : "x1", "targetEntityType" : "item", "targetEntityId" : "i3", "eventTime" : "2015-02-17T02:12:21.934Z" }'
Set the following items as unavailable (need to specify complete list each time when this list is changed):
curl -i -X POST http://localhost:7070/events.json?accessKey=$accessKey \ -H "Content-Type: application/json" \ -d '{ "event" : "$set", "entityType" : "constraint" "entityId" : "unavailableItems", "properties" : { "items": ["i43", "i20", "i37", "i3", "i4", "i5"], } "eventTime" : "2015-02-17T02:11:21.934Z" }'
Set empty list when no more items unavailable:
curl -i -X POST http://localhost:7070/events.json?accessKey=$accessKey \ -H "Content-Type: application/json" \ -d '{ "event" : "$set", "entityType" : "constraint" "entityId" : "unavailableItems", "properties" : { "items": [], } "eventTime" : "2015-02-18T02:11:21.934Z" }'