JSONDecodeError on model load when trained with ignore_column
Author: m10anCreated Sep 10, 2026Updated Sep 10, 2026
Description
Loading the model using lightgbm.Booster fails with a JSONDecodeError. Without mentioning 'ignore_column": "name:ignored' in dataset params, it works fine.
For some reason during deserialization of json params only ignore_columns uses brackets instead of double quotes. Found it by replacing lightgbm.basic.json.loads and inspecting the value passed to it.
..."header": true,"label_column": "nam","group_column": "nam","ignore_column": [nam],...Reproducible example
from pathlib import Path
import lightgbm as lgb
Path('ranking.tsv').write_text("""query_id\tignored\tfeature_1\tfeature_2\trelevance
0\t10\t0.10\t1.00\t0
0\t11\t0.20\t0.90\t1
0\t12\t0.80\t0.20\t2
0\t13\t0.90\t0.10\t3
1\t20\t0.15\t0.95\t0
1\t21\t0.35\t0.75\t1
1\t22\t0.70\t0.30\t2
1\t23\t0.95\t0.05\t3
""")
dataset = lgb.Dataset(
'ranking.tsv',
params={
"header": True,
"label_column": "name:relevance",
"group_column": "name:query_id",
"ignore_column": "name:ignored",
},
)
model = lgb.train(
{
"objective": "lambdarank",
"metric": "ndcg",
"verbosity": -1,
"min_data_in_leaf": 1,
"min_data_in_bin": 1,
"num_leaves": 4,
"force_row_wise": True,
},
dataset,
num_boost_round=1,
)
model.save_model('test_model.txt')
lgb.Booster(model_file='test_model.txt') # JSONDecodeError on 4.6 and 4.7
lgb.Booster(model_str=Path('test_model.txt').read_text()) # JSONDecodeError on 4.7
Environment info
4.6.0 and 4.7.0
conda create -n repro python=3.10
pip install lightgbm==4.6
pip install lightgbm==4.7Source: lightgbm-org/LightGBM