save_model() Feature Importance Section can use a different importance_type #3011
Description
Summary
Currently, the booster.save_model() function does not accept additional params to change the importance type when output the feature importance to the model file. The c++ layer is also hard coded to use 'split' as the importance_type as below.
LightGBM/src/boosting/gbdt_model_text.cpp
Line 367 in 9478e52
So it would be great to have an additional params to be able to change the behavior of feature importance, e.g. uses 'gain' as importance type.
Motivation
We uses LightGBM in our production work, and we show some diagnostic plots, such as feature importance plot, to our customers. But when they inspect the model file, they found a totally different feature importance results than our plots because we use 'gain' as importance_type, while the model file uses 'split'. So it would be great to show consistency to our customers by using the same importance type.
Description
Can we expose APIs like below:
model.booster_.save_model(path, model.booster_.best_iteration, importance_type='gain')