tag | c8cc84ed72118a75e3afed08aaaedd35ff78d230 | |
---|---|---|
tagger | Donald Szeto <donald@prediction.io> | Wed Apr 15 07:11:47 2015 -0700 |
object | cf922b7e29fd8bfccd66601421453e185c38183e |
Compatibility changes for PredictionIO 0.9.2
commit | cf922b7e29fd8bfccd66601421453e185c38183e | [log] [tgz] |
---|---|---|
author | Donald Szeto <donald@prediction.io> | Wed Apr 15 07:10:52 2015 -0700 |
committer | Donald Szeto <donald@prediction.io> | Wed Apr 15 07:10:52 2015 -0700 |
tree | b9c291f2ce339a9a2ec10e31d1932cd4bb1d5abb | |
parent | eebed62029ec61fc31c91a1838f65787ae5ac0e2 [diff] | |
parent | 9c9e8356550a12f76f420185f866a1ed592675c9 [diff] |
Merge branch 'develop'
Please refer to http://docs.prediction.io/templates/ecommercerecommendation/quickstart/
$ 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.
curl -i -X POST http://localhost:7070/events.json?accessKey=zPkr6sBwQoBwBjVHK2hsF9u26L38ARSe19QzkdYentuomCtYSuH0vXP5fq7advo4 \ -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=zPkr6sBwQoBwBjVHK2hsF9u26L38ARSe19QzkdYentuomCtYSuH0vXP5fq7advo4 \ -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=zPkr6sBwQoBwBjVHK2hsF9u26L38ARSe19QzkdYentuomCtYSuH0vXP5fq7advo4 \ -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=zPkr6sBwQoBwBjVHK2hsF9u26L38ARSe19QzkdYentuomCtYSuH0vXP5fq7advo4 \ -H "Content-Type: application/json" \ -d '{ "event" : "$set", "entityType" : "constraint" "entityId" : "unavailableItems", "properties" : { "items": [], } "eventTime" : "2015-02-18T02:11:21.934Z" }'