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

Import LightGBM trained model to metarank #1144

Open
nmtruong93 opened this issue Oct 9, 2023 · 3 comments
Open

Import LightGBM trained model to metarank #1144

nmtruong93 opened this issue Oct 9, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@nmtruong93
Copy link

I did many experiments and finetuned with Optuna, then I got the best model of LightGBM.
Could I use that offline trained model and import / integrate it into Metarank?

@shuttie
Copy link
Collaborator

shuttie commented Oct 9, 2023

I guess the easiest way would be to copy-paste the most optimal params you've got after the optuna into the lightgbm model settings in metarank's config file and retrain. See this section for details: https://docs.metarank.ai/reference/overview/supported-ranking-models#xgboost-and-lightgbm-backend-options

The main issue with importing any trained model is that LGBM has 2.x, 3.x and 4.x formats available and we have to maintain some sort of support for some of these format flavors. It can be a bit tricky if you want to retrain/redeploy your model periodically in an automated way.

@ohuarte-matrix
Copy link

ohuarte-matrix commented Oct 9, 2023

I think could be very valuable, to train a model in an external offline environment, so you can save the model into redis using a new endpoint in your metarank API, so in this API you can control LGBM versions

Thanks for your great work!!!

@nmtruong93
Copy link
Author

Thank you for your answer @shuttie. I agree with @ohuarte-matrix. You can put the model store path as a parameter so that users can train, deploy, and update by themself, like this link.

With meta rank hyper-params are not enough in my settings:

      iterations: Int = 100,
      learningRate: Double = 0.1,
      ndcgCutoff: Int = 10,
      maxDepth: Int = 8,
      seed: Int = 0,
      numLeaves: Int = 16,
      sampling: Double = 0.8

@vgoloviznin vgoloviznin added the enhancement New feature or request label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants