Reputation: 383
LightGBM and XGBoost models can be dumped to plain text files containing human-readable model structure. In the end, they are just tree ensembles.
Is there any library to load these dumped models to the scikit-learn framework, e.g. construct sklearn ensembles with same splits and values?
That could be quiet convinient as there are some nice libraries attached to sklearn API, e.g. treeinterpreter.
Upvotes: 3
Views: 1302
Reputation: 11
For XGBoost you can use the xgbfir library which parses the xgb model display feature interactions and ranking. Install it with:
pip install xgbfir
For lightGBM, I'm not aware of good options. Microsoft's lightGBM library allows PMML export, so perhaps you could export then use some PMML parsers.
Upvotes: 1