Herwini
Herwini

Reputation: 437

Is the importance_type 'split' of lightgbm the same as the importance_type 'weight` in xgboost?

Is the importance_type 'split' of lightgbm the same as the importance_type 'weight' in xgboost?

In other words, are the following the same?

booster.feature_importance(importance_type = 'split') # for lightgbm 

and

get_fscore(importance_type='weight') # for xgboost

Upvotes: 1

Views: 1154

Answers (1)

desertnaut
desertnaut

Reputation: 60317

Despite the slightly different wording, they are the same indeed.

From the LightGBM docs:

If "split", result contains numbers of times the feature is used in a model.

From the XGBoost docs:

'weight’: the number of times a feature is used to split the data across all trees.

No coincidence that these importance types are the default choices in the two packages respectively.

Upvotes: 2

Related Questions