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

[🐛BUG] self._dataset in KnowledgeBasedDataLoader #1743

Open
giuspillo opened this issue Apr 20, 2023 · 4 comments
Open

[🐛BUG] self._dataset in KnowledgeBasedDataLoader #1743

giuspillo opened this issue Apr 20, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@giuspillo
Copy link

Dear authors,

I guess I found a bug related to these two lines of code.

Context: I wanted to compare some recommendation algorithms, and some of them are Knowledge-Aware.
But when I use some ranking metrics to evaluate performances, I get this Exception: 'KnowledgeBasedDataLoader' object has no attribute 'dataset'.

I solved the issue by (1) changing this line to

self.dataset = dataset
by removing the _

and (2) similarly

self.data_struct.set("data.num_items", train_data.dataset.num(item_id))

self.data_struct.set("data.num_users", train_data.dataset.num(user_id))

self.data_struct.set("data.count_items", train_data.dataset.item_counter)

self.data_struct.set("data.count_users", train_data.dataset.user_counter)

to

self.data_struct.set("data.num_items", train_data._dataset.num(item_id))
self.data_struct.set("data.num_users", train_data._dataset.num(user_id))
self.data_struct.set("data.count_items", train_data._dataset.item_counter)
self.data_struct.set("data.count_users", train_data._dataset.user_counter)

For some reason this worked, so maybe it could indicate an error or bug.

@giuspillo giuspillo added the bug Something isn't working label Apr 20, 2023
@Sherry-XLL Sherry-XLL self-assigned this Apr 21, 2023
@Sherry-XLL
Copy link
Member

@giuspillo Hello! Thanks for your attention to RecBole!

The definition of dataset and _dataset is updated in the latest version of RecBole, and there may be some legacy issues. Please give some information of your model and dataset so that we can reproduce this problem and solve it.

Alternatively, we would also like to ask for your help to verify this: if you only change the four variables of collector.py mentioned in point (2) without modifying the knowledge_dataloader.py of (1) is the result still correct. We also greatly welcome you to submit your modifications directly to our library by putting forward Pull Requests, contributing to the open-source library.

Thank you again for your feedback.

@giuspillo
Copy link
Author

Dear authors,

here is the link to the dataset I used: https://mega.nz/file/OxNwiLKb#rKmK9URjxrANIxtGZBVws24L8syhk2JrR4LHiadutHw

It's a movielens 1m dataset, we added some properties (not relevant for SLIMElastic); moreover, you may notice the validation split is empty, this has been done to guarantee fairness when comparing to other (our) models which operate only on train and test.

Unfortunately, at the moment I cannot test anything since the computer is being used my one of my colleagues; I'll try in some days.

@giuspillo
Copy link
Author

Pull request made here, I found another bug reported in the pull request, which has been solved, related to SLIMElastic

@Sherry-XLL
Copy link
Member

Hello @giuspillo!

Thanks for your attention to our library. Please pay attention to the comments in #1745, and we will review your code and merge the pull request in time.

Thanks again for your suggestions and feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants