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

Support sklearn cross validation for ranker. #8859

Merged
merged 8 commits into from
Mar 6, 2023

Conversation

trivialfis
Copy link
Member

  • Add a convention for X to include a special qid column.

sklearn utilities consider only X, y, and sample_weight for supervised learning algorithms, but we need an additional qid array for ranking.

It's important to be able to support the cross-validation function in sklearn since all other tuning functions like grid search are based on cross-validation.

I plan to deprecate the use of group. qid is the most widely used convention in learning to rank implementations.

Extracted from #8822 .

@trivialfis
Copy link
Member Author

The convention is primarily for the score function since cross_validate accepts a fit_params parameter.

@trivialfis trivialfis force-pushed the ltr-cv branch 2 times, most recently from ee85812 to bda0f4e Compare March 2, 2023 03:17
Copy link
Member

@RAMitchell RAMitchell left a comment

Choose a reason for hiding this comment

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

Nice work!

- Add a convention for X to include a special `qid` column.

sklearn utilities consider only `X`, `y` and `sample_weight` for supervised learning
algorithms, but we need an additional qid array for ranking.

It's important to be able to support the cross validation function in sklearn since all
other tuning functions like grid search are based on cross validation.
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.

2 participants