question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LightGBM does not save numIteration to string or native model

See original GitHub issue

Describe the bug When the LightGBM model early stopped, LightGBMBooster.numIterations is set and this value will be passed to lightgbmlib while calling predictForCSR or predictForMat. However, saveToString and saveNativeModel do not save this information. Therefore, when we load the model from the saved string or native model again, the predictions would be different from the original model.

To Reproduce Steps to reproduce the behavior, code snippets encouraged

Expected behavior According to the LightGBM python library, it saves the best iteration by default. https://github.com/microsoft/LightGBM/blob/v3.3.2/python-package/lightgbm/basic.py#L3298

Info (please complete the following information):

  • SynapseML Version: 0.9.5
  • Spark Version: 3.2.0
  • Spark Platform: local

** Stacktrace**

Please post the stacktrace here if applicable

If the bug pertains to a specific feature please tag the appropriate CODEOWNER for better visibility @imatiach-msft

Additional context Add any other context about the problem here.

AB#1764742

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
svotawcommented, May 9, 2022

nevermind, found the issue. fixing it. 😃

0reactions
djshencommented, May 11, 2022

Hi @svotaw,

Thank you for the fix! We will test this build later.

Read more comments on GitHub >

github_iconTop Results From Across the Web

synapse.ml.lightgbm package - NET
Load the model from a native LightGBM model string. ... None (string, not a None value) means that no metric will be registered,...
Read more >
LightGBM | SynapseML - Microsoft Open Source
This framework specializes in creating high-quality and GPU enabled decision tree algorithms for ranking, classification, and many other machine learning tasks.
Read more >
lightgbm.Booster — LightGBM 3.3.3.99 documentation
Save Booster to string. Parameters. num_iteration (int or None, optional (default=None)) – Index of the iteration that should be saved.
Read more >
Save LGBMRegressor model from python lightgbm package ...
Hi I am unable to find an way to save and reuse an LGBM model to a file. I used python package lightgbm...
Read more >
CatBoost vs. Light GBM vs. XGBoost - Towards Data Science
In order to keep the same data distribution, when computing the ... Note: If a column having string values is not provided in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found