Need help with xgbfi?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

Far0n
461 Stars 89 Forks MIT License 9 Commits 6 Opened issues

Description

XGBoost Feature Interactions & Importance

Services available

!
?

Need anything else?

Contributors list

No Data

Xgbfi

XGBoost Feature Interactions & Importance

What is Xgbfi?

Xgbfi is a XGBoost model dump parser, which ranks features as well as feature interactions by different metrics.

Siblings

Xgbfir - Python porting

The Metrics

  • Gain: Total gain of each feature or feature interaction
  • FScore: Amount of possible splits taken on a feature or feature interaction
  • wFScore: Amount of possible splits taken on a feature or feature interaction weighted by the probability of the splits to take place
  • Average wFScore: wFScore divided by FScore
  • Average Gain: Gain divided by FScore
  • Expected Gain: Total gain of each feature or feature interaction weighted by the probability to gather the gain
  • Average Tree Index
  • Average Tree Depth

Additional Features

  • Leaf Statistics
  • Split Value Histograms

Example:

Usage

[mono] XgbFeatureInteractions.exe [-help|options]

Quick Guide

a) Creating a feature map (fmap) ```python def createfeaturemap(fmapfilename, features): """ features: enumerable of feature names """ outfile = open(fmapfilename, 'w') for i, feat in enumerate(features): outfile.write('{0}\t{1}\tq\n'.format(i, feat)) outfile.close()

createfeaturemap('xgb.fmap', features) ```

b) Dumping a XGBoost model

python
gbdt.dump_model('xgb.dump',fmap='xgb.fmap', with_stats=True)

c) Editing Parameters in XgbFeatureInteractions.exe.config

xml

    xgb.dump

d) Running [mono] XgbFeatureInteractions.exe without cmd line parameters

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.