-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[WIP] Added Logistic Matrix Factorization(LMF) and Item2Vec models #48681
Open
ezamyatin
wants to merge
104
commits into
apache:master
Choose a base branch
from
ezamyatin:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
In this pull request, I add two important algorithms from the recommendation domain: Logistic Matrix Factorization(LMF) and Item2Vec. Both algorithms inherit the same LogFacBase class and are built under the same optimization backend. The first algorithm is an alternative to the well-known ALS: the key difference is that LMF uses a logistic loss function, while ALS uses a regression function. In most recommendation problems, the logistic loss function is better grounded in theory, so I am sure LMF will be useful to the community.
The second algorithm is actually a large-scale implementation of the SkipGram version of the Word2Vec algorithm with negative sampling. The key difference from the existing Word2Vec implementation in spark is that my proposed implementation allows to train models of any large size, while the existing one is limited by the size of 2Gb. I would like to note that this feature is vital in the area of recommendations, where the size of the inventory can exceed hundreds of millions of items.
Why are the changes needed?
Proposed models are widely used in the industry, large-scale implementation in spark will help thousands of recommendation system developers to improve their services.
Does this PR introduce any user-facing change?
Yes, two new classes will be available for use: LMF and Item2Vec
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?
No.