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 change lightgbm josn model to sql ? #3400

Closed
Liansy opened this issue Sep 16, 2020 · 9 comments
Closed

how to change lightgbm josn model to sql ? #3400

Liansy opened this issue Sep 16, 2020 · 9 comments
Labels

Comments

@Liansy
Copy link

Liansy commented Sep 16, 2020

Summary

Motivation

Description

References

@Liansy
Copy link
Author

Liansy commented Sep 16, 2020

I want to parse the JSON rule format of the lightgbm model into SQL statements for deployment on the database. Is there any good solution?

@jameslamb
Copy link
Collaborator

Hi @Liansy , thanks for using LightGBM! We don't have any code in this project that allows you to code-generate SQL from a trained model.

You can look through the list of LightGBM extensions to see if any of them have that type of functionality.

I know that such projects exist generally, like sqlflow, but I'm not aware of any that have support for LightGBM.

That project supports XGBoost (https://github.com/sql-machine-learning/sqlflow/blob/253578d4d2cb4e96f2162d77b97a31c9a0f6af81/doc/design/xgboost_on_sqlflow.md), so maybe if you raise an issue there they would also support LightGBM models.

@jameslamb
Copy link
Collaborator

For my own knowledge, could you explain why you're looking to use a SQL representation instead of, say, Python or C++?

@Liansy
Copy link
Author

Liansy commented Sep 18, 2020

For my own knowledge, could you explain why you're looking to use a SQL representation instead of, say, Python or C++?
In the process of project deployment, we usually use Python as a model building tool. However, when we finally deploy to the application, we can only deploy through hive SQL. We can't obtain the permission to use Java or C + +. Therefore, we want to parse the JSON model results saved by lightgbm into SQL case when.

@jameslamb
Copy link
Collaborator

I suspected that might be the case, thank you!

Unfortunately we do not support this today and I'm not aware of a project that does. I recommend opening an issue in https://github.com/sql-machine-learning/sqlflow and linking to this issue (so others who find this via search will know to go there).

@StrikerRUS @guolinke do you agree with that? Or do you think we should add this as a feature request in our backlog here? If we add it as a feature request here, I think it should be limited to scoring and we should not attempt training in SQL like sqlflow has done.

@Liansy
Copy link
Author

Liansy commented Sep 18, 2020

Thank you!

@StrikerRUS
Copy link
Collaborator

@jameslamb I agree with you. It looks like a task for special libraries focused on ML with SQL, not for LightGBM main repo.

@jameslamb
Copy link
Collaborator

Ok great, I can see you've opened sql-machine-learning/sqlflow#2942 so I will close this.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants