-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query top N recommended items #24
Comments
Its the index into the matrix you passed into the 'fit' function - you'll need to map from the category id in your 'rows' back to the category. The example file shows how to do this here https://github.com/benfred/implicit/blob/master/examples/lastfm.py#L122-L128 Also the userid in the 'recommend' method is the column id in the item_users matrix. |
You can create a mapping like this:
The first will create a dictionary where each key is a
The second is just the reverse mapping:
So in the |
Hi Ben,
I'm using implicit to predict a top7list of recommendations using a sparse matrix of aggregated customer purchases composed of 7101 customer purchases from 24 products.
The issue I'm having is that I'm a little confused at the output from .recommend which produces a list of N tuples:
[(845, 1.0136324354312989), (1150, 1.0028331824506354), (51, 1.0027650376439357), (2411, 1.0024685562873292), (1810, 1.0019960930254448), (1211, 1.0018685279069661), (775, 1.0018545578136604)]
Now I would have expected the first value in the tuple to be an index to the product list, but I suspect that I'm looking at the indices for the latent factor vectors? If you give me a steer about the process for extracting out the product identities it would be very much appreciated.
Kind regards,
Michael.
`
The text was updated successfully, but these errors were encountered: