Please refer to http://predictionio.incubator.apache.org/templates/similarproduct/quickstart/
Update for Apache PredictionIO 0.10.0-incubating
- Fix CooccurrenceAlgorithm with unknown item ids
- Add CooccurrenceAlgorithm.
To use this algorithm, override
engine.json
byengine-cooccurrence.json
, or specify--variant engine-cooccurrence.json
parameter for both$pio train
and$pio deploy
-
update for PredictionIO 0.9.2, including:
- use new PEventStore API
- use appName in DataSource parameter
- update build.sbt and template.json for PredictionIO 0.9.2
- cache mllibRatings RDD in algorithm train() because it is used at multiple places (non-empty data check and ALS)
- update for PredictionIO 0.9.0
- Persist RDD to memory (.cache()) in DataSource for better performance
- Use local model for faster serving.
- initial version
$ python data/import_eventserver.py --access_key <your_access_key>
normal:
curl -H "Content-Type: application/json" \
-d '{ "items": ["i1", "i3", "i10", "i2", "i5", "i31", "i9"], "num": 10}' \
http://localhost:8000/queries.json \
-w %{time_connect}:%{time_starttransfer}:%{time_total}
curl -H "Content-Type: application/json" \
-d '{
"items": ["i1", "i3", "i10", "i2", "i5", "i31", "i9"],
"num": 10,
"categories" : ["c4", "c3"]
}' \
http://localhost:8000/queries.json \
-w %{time_connect}:%{time_starttransfer}:%{time_total}
curl -H "Content-Type: application/json" \
-d '{
"items": ["i1", "i3", "i10", "i2", "i5", "i31", "i9"],
"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 '{
"items": ["i1", "i3", "i10", "i2", "i5", "i31", "i9"],
"num": 10,
"blackList": ["i21", "i26", "i40"]
}' \
http://localhost:8000/queries.json \
-w %{time_connect}:%{time_starttransfer}:%{time_total}
unknown item:
curl -H "Content-Type: application/json" \
-d '{ "items": ["unk1", "i3", "i10", "i2", "i5", "i31", "i9"], "num": 10}' \
http://localhost:8000/queries.json \
-w %{time_connect}:%{time_starttransfer}:%{time_total}
all unknown items:
curl -H "Content-Type: application/json" \
-d '{ "items": ["unk1", "unk2", "unk3", "unk4"], "num": 10}' \
http://localhost:8000/queries.json \
-w %{time_connect}:%{time_starttransfer}:%{time_total}