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

How to set qid when predict in LGBMRanker? #1398

Closed
deepfuzzy opened this issue May 24, 2018 · 7 comments
Closed

How to set qid when predict in LGBMRanker? #1398

deepfuzzy opened this issue May 24, 2018 · 7 comments

Comments

@deepfuzzy
Copy link

deepfuzzy commented May 24, 2018

In python, qid can be set to group in fit(X, y, group), but predict() has no parameter group, so where to set qid?

@guolinke
Copy link
Collaborator

qid is not needed in prediction. LightGBM will predict the relevant score, and you should rank the result by yourself.

@mlisovyi
Copy link
Contributor

mlisovyi commented Oct 8, 2018

@guolinke is it possible to elaborate more on this? Shall one make predictions on each group separately? What is the output of the LGBM.predict() method? The docs are very short on the subject and examples in the tests and elsewhere address rnker fit, but not prediction

@guolinke
Copy link
Collaborator

guolinke commented Oct 8, 2018

@mlisovyi qid have no effects on ranking predictions in lgb.predict, as the predicted results are the relevant scores. And you can use the relevant scores to get the correct ranking order results by yourself, and qid is needed in this step.

@mlisovyi
Copy link
Contributor

mlisovyi commented Oct 8, 2018

I see... How to treat negative values in the predictions?

@guolinke
Copy link
Collaborator

guolinke commented Oct 8, 2018

@mlisovyi the same, you can just sort by prediction values.

@nonva
Copy link

nonva commented Sep 4, 2019

but, not in same query group, is the scores can be comparable?

@guolinke
Copy link
Collaborator

guolinke commented Sep 4, 2019

@nonva theoretically, they could be comparable.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants