user606521
user606521

Reputation: 15454

How to export/access recommendations for all users in Oryx?

There is Oryx running on Ubuntu. It is configured to read csv files from some directory to update recommendations. What I need is to get full list of recommendations (all users and 100 recommendations per each user) to insert it back to Postgres database. How I can get those recommendations? API allows me only to retrieve recommendations for single user.

Upvotes: 1

Views: 94

Answers (1)

Rich
Rich

Reputation: 132

If I understand the question correctly, I think it just comes down to running a loop in a script. If you are able to get what you need from a query on a single user, then try writing a script to loop the query over all users. A pseudo-python script may look something like this:

import requests

# Define the endpoint to get a recommendation for a single user
endpoint = 'http://<SERVING LAYER IP>:8091/reccomend/'

# Loop this query over all users
for i in xrange(userID):
  recommendation[i] = requests.get(endpoint + userID[i])

Of course, what you do with each recommendation[i] for each userID[i] depends on output format, etc., but the idea is to perform the single user query over all users using a script.

Upvotes: 0

Related Questions