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.56k stars 3.82k forks source link

get_split_value_histogram XGBoost equivalent in LightGBM #2013

Closed dsl10brc closed 5 years ago

dsl10brc commented 5 years ago

I want histogram/values of all the splits happening in a particular feature. Just like get_split_value_histogram in XGBoost. Is there any way to get it currently?

I am aware of plot_tree and create_tree_digraph methods. But those are for visualizations

guolinke commented 5 years ago

I think this could be achieved by tree models. You can use dump_model: https://lightgbm.readthedocs.io/en/latest/Python-API.html#lightgbm.Booster.dump_model, to get the model content. And then get your statistics from the model. @StrikerRUS do you think this function is needed? maybe we can implement one in python-package.

StrikerRUS commented 5 years ago

@guolinke I haven't heard about such function. It seems to be a useful feature, I'll take a look.