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] NMF: Handle 0 ratings #367

Merged
merged 2 commits into from
Aug 13, 2022
Merged

[FIX] NMF: Handle 0 ratings #367

merged 2 commits into from
Aug 13, 2022

Conversation

VesnaT
Copy link
Contributor

@VesnaT VesnaT commented Aug 14, 2020

Issue

NMF crashed with ZeroDivisionError: float division when all ratings for a user (or. an item) were 0.

Description of changes

Fix sgd() to skip update step when the rating is 0.

Alternative approach

The rating could be 'fixed' to a very small number to enable further updates.

@DavidChenLondon
Copy link

LGTM, I'm also experiencing the same error.

Copy link
Owner

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the fix @VesnaT ! and @DavidChenLondon for checking.

This LGTM, I just added a test in 23f74ed.

@NicolasHug NicolasHug merged commit a6b84d7 into NicolasHug:master Aug 13, 2022
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.

3 participants