DreamHouse PredictionIO Recommendation Engine

This app uses PredictionIO to provide property recommendations based on users' favorites.

Check out a demo:

Demo

Run on Heroku:

  1. Sign up for a free Heroku account

  2. Install the Heroku Toolbelt

  3. Deploy the PredictionIO Event Server on Heroku: Deploy on Heroku

  4. Create a new app in the PredictionIO Event Server:

     heroku run console app new dreamhouse -a <YOUR EVENT SERVER APP NAME>
    
  5. Deploy the DreamHouse Web App (pio branch): Deploy on Heroku

  6. Deploy the recommendation engine: Deploy on Heroku

  7. 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>
    
  8. 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>
    
  9. Check out the recommendation in the DreamHouse Web App

Run Locally:

  1. Setup a local PredictionIO Event Server: https://github.com/jamesward/pio-eventserver-heroku

  2. Setup a local DreamHouse Web App using the pio branch: https://github.com/dreamhouseapp/dreamhouse-web-app/tree/pio

  3. Setup a local PredictionIO Recommendation Engine: https://github.com/dreamhouseapp/dreamhouse-pio

  4. 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"
    
  5. Check the status of your engine:

    http://localhost:8000

  6. Check out the recommendations for an item:

     curl -H "Content-Type: application/json" -d '{"userId": "c1", "numResults": 3 }' -k http://localhost:8000/queries.json