xgbfi

by Far0n

Far0n /xgbfi

XGBoost Feature Interactions & Importance

458 Stars 87 Forks Last release: Not found MIT License 9 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

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.