DreamHouse PredictionIO Recommendation Engine
This app uses PredictionIO to provide property recommendations based on users' favorites.
Check out a demo:
Run on Heroku:
-
Create a new app in the PredictionIO Event Server:
heroku run console app new dreamhouse -a <YOUR EVENT SERVER APP NAME>
-
Attach your PredictionIO Event Server's Postgres to the recommendation engine app:
Remove the auto-added Heroku Postgres addon:
heroku addons:destroy heroku-postgresql -a <YOUR ENGINE APP NAME>
Lookup the Heroku Postgres Addon ID for the Event Server's Postgres:
heroku addons -a <YOUR EVENT SERVER HEROKU APP NAME>
Attach the Postgres Addon to the Engine:
heroku addons:attach <YOUR ADDON ID> -a <YOUR ENGINE APP NAME>
-
Configure the DreamHouse Web App to know where to pull recommendations from by setting the
PIO_ENGINE_URL
to the base URL of your PIO Engine app (e.g.https://foo.herokuapp.com
):heroku config:set PIO_ENGINE_URL=<URL FOR YOUR RECOMMENDATION SERVER> -a <YOUR DREAMHOUSE WEB APP NAME>
-
Check out the recommendation in the DreamHouse Web App
Run Locally:
-
Setup a local PredictionIO Event Server: https://github.com/jamesward/pio-eventserver-heroku
-
Setup a local DreamHouse Web App using the
pio
branch: https://github.com/dreamhouseapp/dreamhouse-web-app/tree/pio -
Setup a local PredictionIO Recommendation Engine: https://github.com/dreamhouseapp/dreamhouse-pio
-
Train the app and run the recommendation engine:
cd dreamhouse-pio source bin/env.sh && DREAMHOUSE_WEB_APP_URL=http://localhost:8200 ACCESS_KEY=<YOUR ACCESS KEY> ./sbt "runMain ServerApp"
-
Check the status of your engine:
-
Check out the recommendations for an item:
curl -H "Content-Type: application/json" -d '{"userId": "c1", "numResults": 3 }' -k http://localhost:8000/queries.json