Bump PredictionIO to 0.14.0 (#8)
Please refer to https://predictionio.apache.org/templates/javaecommercerecommendation/quickstart/.
Update for Apache PredictionIO 0.14.0
Update for Apache PredictionIO 0.13.0
add “org.jblas” dependency in build.sbt
$ python data/import_eventserver.py --access_key <your_access_key>
normal:
$ curl -H "Content-Type: application/json" \ -d '{ "userEntityId" : "u1", "number" : 10 }' \ http://localhost:8000/queries.json
$ curl -H "Content-Type: application/json" \ -d '{ "userEntityId" : "u1", "number": 10, "categories" : ["c4", "c3"] }' \ http://localhost:8000/queries.json
curl -H "Content-Type: application/json" \ -d '{ "userEntityId" : "u1", "number": 10, "whitelist": ["i21", "i26", "i40"] }' \ http://localhost:8000/queries.json
curl -H "Content-Type: application/json" \ -d '{ "userEntityId" : "u1", "number": 10, "blacklist": ["i21", "i26", "i40"] }' \ http://localhost:8000/queries.json
unknown user:
curl -H "Content-Type: application/json" \ -d '{ "userEntityId" : "unk1", "number": 10}' \ http://localhost:8000/queries.json
new user:
curl -H "Content-Type: application/json" \ -d '{ "userEntityId" : "x1", "number": 10}' \ http://localhost:8000/queries.json
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" }'
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
E-Commerce Recommendation Template in Java
Documentation
Please refer to https://predictionio.apache.org/templates/javaecommercerecommendation/quickstart/.
Versions
v0.14.0
Update for Apache PredictionIO 0.14.0
v0.13.0
Update for Apache PredictionIO 0.13.0
v0.12.0-incubating
v0.11.0-incubating
v0.1.2
add “org.jblas” dependency in build.sbt
v0.1.1
v0.1.0
Development Notes
Import Sample Data
Query
normal:
unknown user:
Handle New User
new user:
import some view events and try to get recommendation for x1 again.
Handle Unavailable Items
Set the following items as unavailable (need to specify complete list each time when this list is changed):
Set empty list when no more items unavailable: