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

Difference between Hybrid CF Model and Learning-to-Rank Model #442

Closed
wenqinglim opened this issue Apr 4, 2019 · 7 comments
Closed

Difference between Hybrid CF Model and Learning-to-Rank Model #442

wenqinglim opened this issue Apr 4, 2019 · 7 comments

Comments

@wenqinglim
Copy link

wenqinglim commented Apr 4, 2019

Hi,

I'm a little confused when looking at the examples in the documentation.
What is the difference between the Hybrid and Learning-to-Rank models implemented here?

From the documentation, a Hybrid model is defined by:

model = LightFM(loss='warp',
                item_alpha=ITEM_ALPHA,
                no_components=NUM_COMPONENTS)

A Learning-to-Rank model is defined by:

warp_model = LightFM(no_components=num_components,
                    loss='warp',
                    learning_schedule='adagrad',
                    max_sampled=100,
                    user_alpha=alpha,
                    item_alpha=alpha)

The default lightFM model is:

LightFM(no_components=10, k=5, n=10, learning_schedule=’adagrad’, 
loss=’logistic’, learning_rate=0.05, rho=0.95, epsilon=1e-06, item_alpha=0.0, 
user_alpha=0.0, max_sampled=10, random_state=None)

I'm having trouble seeing a difference between both models. Does LightFM differentiate between the Hybrid CF and Learning-to-Rank? How do I make sure the model that I'm creating is a Hybrid model or a Learning-to-Rank model?

Would appreciate any advice on this. Thank you!

@impaktor
Copy link

impaktor commented Apr 4, 2019

For me "learning to rank" is what you call the BPR and the WARP loss functions.

E.g. see:
https://www.ethanrosenthal.com/2016/11/07/implicit-mf-part-2/

I'm not sure what makes you think "learning to rank" and hybrid model would be disjunct.

@wenqinglim
Copy link
Author

For me "learning to rank" is what you call the BPR and the WARP loss functions.

E.g. see:
https://www.ethanrosenthal.com/2016/11/07/implicit-mf-part-2/

I'm not sure what makes you think "learning to rank" and hybrid model would be disjunct.

Thank you for your reply!

Does this mean that as long as I specifyloss='bpr' or loss='warp' , it is a learning-to-rank model?

Also, just to clarify, is learning-to-rank a subset of CF and Hybrid models?

@maciejkula
Copy link
Collaborator

Learning-to-rank and CF/hybrid models are largely independent concepts. Both bpr and warp are ranking losses.

@wenqinglim
Copy link
Author

Learning-to-rank and CF/hybrid models are largely independent concepts. Both bpr and warp are ranking losses.

Yes, that is what I thought! Could you explain how I could run a LTR and CF/Hybrid on LightFM? How do I make sure the model that I'm creating is a Hybrid model or a Learning-to-Rank model?

@maciejkula
Copy link
Collaborator

  1. If use use the warp or bpr losses, your model is a learning-to-rank model.
  2. If you have any features in your item or user feature matrices (other than the identity features per item/user), your model is a hybrid model.

@wenqinglim
Copy link
Author

That seems very clear, but what if I'm using warp or bpr losses and also using additional user/item features? Is it still a Hybrid CF model?

@SimonCW
Copy link
Collaborator

SimonCW commented Jan 24, 2021

I’m closing this issue because it has been inactive for a long time. If you still encounter the problem, please open a new issue.

Thank you!

@SimonCW SimonCW closed this as completed Jan 24, 2021
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

No branches or pull requests

4 participants