Skip to content

Conversation

@hieuddo
Copy link
Member

@hieuddo hieuddo commented May 4, 2024

Description

The two methods knows_user and knows_item check whether uid (or iid) is smaller than self.num_users (or self.num_items), which doesn't exist because fit() was never executed.

This commit tries to fix an error in recommender-systems tutorial notebook 7, where EFM.train_set is assigned and _build_matrices() is executed before fit():

efm = EFM()
efm.train_set = rs.train_set
_, X, Y = efm._build_matrices(rs.train_set)

@hieuddo hieuddo added the bug Something isn't working label May 4, 2024
@hieuddo hieuddo requested review from lthoang and qtuantruong May 4, 2024 02:08
@qtuantruong
Copy link
Member

@hieuddo @lthoang how about modifying the tutorial to the following?

efm = EFM(max_iter=0)
efm.fit(train_set=rs.train_set)

I think it serves the same purpose and looks cleaner.

@hieuddo
Copy link
Member Author

hieuddo commented May 5, 2024

@tqtg I think your suggestion makes sense. efm.fit(train_set=rs.train_set) seems more conventional than directly assign train_set by efm.train_set = rs.train_set.

Anyway, could you help to release new cornac version with the recent Recommender.rank() fix so that EFM can run smoothly?

@qtuantruong
Copy link
Member

@hieuddo we have a new version released. Should we check if the above approach works for the tutorial? and do we need to work on this change anymore?

@hieuddo
Copy link
Member Author

hieuddo commented May 7, 2024

@tqtg Yes, it works. There is no need for this change. Thanks

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

Successfully merging this pull request may close these issues.

2 participants