Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Recommender Exclude Parameter Not Working #1164

Closed
TobyRoseman opened this issue Oct 26, 2018 · 2 comments · Fixed by #1507
Closed

Recommender Exclude Parameter Not Working #1164

TobyRoseman opened this issue Oct 26, 2018 · 2 comments · Fixed by #1507

Comments

@TobyRoseman
Copy link
Collaborator

The exclude parameter for recommend does not seem to work:

import turicreate
sf = turicreate.SFrame({'user_id': ["0", "0", "0", "1", "1", "2", "2", "2"],
                       'item_id': ["a", "b", "c", "a", "b", "b", "c", "d"],
                       'rating': [1, 3, 2, 5, 4, 1, 4, 3]})
m = turicreate.recommender.create(sf, target='rating')

recs1 = m.recommend(users=[1])
print(recs1) # correctly recommending 'c' to 1

exclude = turicreate.SFrame({'item_id': ['c'], 'user_id': [1]})
rec2 = m.recommend(users=[1], exclude=exclude)
print(rec2)  # still recommending 'c' to 1
@hoytak
Copy link
Collaborator

hoytak commented Oct 26, 2018

This is because the user_id specified in the exclude frame is a numeric 1, whereas the one in the users column of the original data is a string. It appears that some of the casting logic is inconsistent.

@nickjong nickjong added this to the 5.4 milestone Feb 4, 2019
@TobyRoseman
Copy link
Collaborator Author

@hoytak - could you share some more details about how you determined it's a casting logic inconsistency? Where in the code base is the relevant casting logic (i.e. is it in Cython or ML data)?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants