Skip to content
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

Fix GCMC Invalid Key Error #533

Merged
merged 3 commits into from
Oct 19, 2023

Conversation

darrylong
Copy link
Member

Description

For instances when predicting scores and item_idx is none:

  • It currently throws a "invalid key" error for something that has not been seen

Solved by returning a default score instead.

Related Issues

Checklist:

  • I have added tests.
  • I have updated the documentation accordingly.
  • I have updated README.md (if you are adding a new model).
  • I have updated examples/README.md (if you are adding a new example).
  • I have updated datasets/README.md (if you are adding a new dataset).

@darrylong darrylong requested a review from tqtg October 17, 2023 10:17
@darrylong darrylong self-assigned this Oct 17, 2023
@darrylong darrylong changed the title Add missing default scores when item_idx is none Fix GCMC Invalid Key Error Oct 17, 2023
@tqtg
Copy link
Member

tqtg commented Oct 17, 2023

@darrylong to make it right, I think we need to do something similar to the predict function. Basically, we need to create a test decoding graph for that particular user (connecting from the user node to all item nodes), then call the model and obtain predicted ratings for all items. Let me know what you think.

@darrylong
Copy link
Member Author

@darrylong to make it right, I think we need to do something similar to the predict function. Basically, we need to create a test decoding graph for that particular user (connecting from the user node to all item nodes), then call the model and obtain predicted ratings for all items. Let me know what you think.

I think that should work. I'll give it a try!

@darrylong
Copy link
Member Author

@tqtg while I was attempting to add individual dec_graphs of each user, I thought about the possibility of adding all items for users in the test set into the dec_graph. This could potentially help with the retrieval of scores, but would like to check if this is theoretically correct.

@tqtg
Copy link
Member

tqtg commented Oct 18, 2023

Do you mean we compute scores for all users in the test set at once?

@darrylong
Copy link
Member Author

Do you mean we compute scores for all users in the test set at once?

That's right. In a single dec_graph just like in the predict function.

@darrylong darrylong merged commit a25054d into PreferredAI:master Oct 19, 2023
12 checks passed
@darrylong darrylong deleted the hotfix-gcmc-default-scoring branch October 19, 2023 06:07
darrylong added a commit to darrylong/cornac that referenced this pull request Oct 23, 2023
* Add missing default scores when item_idx is none

* Added all items into test_dec_graph for all users

* changed to create dec_graph for each user when scoring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants