microsoft / LightGBM

A fast, distributed, high performance gradient boosting (GBT, GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks.
https://lightgbm.readthedocs.io/en/latest/
MIT License
16.52k stars 3.82k forks source link

Problems when modifying model file #3232

Closed kobics closed 4 years ago

kobics commented 4 years ago

How you are using LightGBM?

LightGBM component:

Environment info

Operating System: Linux

CPU/GPU model: NA

C++ compiler version: NA

CMake version: NA

Java version: NA

Python version: conda install 2.3.0

R version: NA

Other: NA

LightGBM version or commit hash: NA

Error message and / or logs

Hi We would like to modify a model file, but few things seems wrong. 1 When we modify shrinkage/leaf values, and load, sometime the kernel dies 2 When we modify the shrinkage, and load the model (And the kernel does not die), the predictions are the same as the original model, before modifying the shrinkage

Thanks

Reproducible example(s)

Steps to reproduce

  1. Build LightGBM regression model
  2. Save model to text file
  3. Modify shrinkage/leaf values
  4. Load and predict using the modified model

Two issues a. either the kernel dies (both modifications) b. the model predictions do not change (it if not dies) (in case of shrinkage change)

guolinke commented 4 years ago

@kobics if you change the model file manually, you should remove the tree_size field.

github-actions[bot] commented 1 year ago

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.