-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Output model from Python to C/C++ in if/else format #769
Comments
We have this feature. BTW, the decision_type = 2 is out of date now. maybe you need to retrain your model with the latest code. @wxchan can you add more documents for the if-else conversion ? |
I just built the latest lightGBM yesterday so that's strange that I am getting that decision type. With save_model? |
@sami043 you can add I actually never tried it from python. You can take a try. @guolinke I will write some docs maybe tomorrow. |
@wxchan,
params = {
'task': 'train',
'convert_model_language': 'cpp',
'convert_model': 'C:\Some\Path\'
}
did not yield any outputs.
@guolinke just updated to latest. I have num_cat but decision_type = 2 is still present.
…On Wed, Aug 2, 2017 at 10:38 AM, wxchan ***@***.***> wrote:
@sami043 <https://github.com/sami043> you can add convert_model=SOME_PATH
and convert_model_language=cpp to params , 1st is output address and 2nd
is output language(now c++ is only option). And you need to re-compile c++
and python to make it work.
I actually never tried it from python. You can take a try.
@guolinke <https://github.com/guolinke> I will write some docs maybe
tomorrow.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#769 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AdPb5hM6rmIOd5yt7TBOjx3XSUG8mPX_ks5sUJgNgaJpZM4OrNXX>
.
|
@sami043 sorry, I forgot. It is only implemented in command line version now. |
Thanks for the quick replies. Are there plans to expand it to non-command line later on? Or would it be possible to load a .txt model through the command line interface and export the .cpp code? |
That did the trick! Thanks! |
Hey, |
Is there also a guide somewhere on how to use the converted C++ model? I can't find anything using Google. |
Is there any built in method to export the model to .c/.cpp in if/else format? I could potentially parse the text model but that may be a little more prone to error. I saw on here someone had created a python script to do it for binary but for multiclaas it requires modifications. Specifically, what does a decision type of '2' represent?
The text was updated successfully, but these errors were encountered: