0

I'm trying to use eli5.show_prediction to explain feature importance at the record level. Below is part of the results I'm getting.

The raw score value shown below is -0.329, which corresponds to probability value exp(-0.329)/(exp(-0.329) + 1) = 0.418484. However, the probability I calculated for this record using my XGB model turns out to be 0.8953. Is this difference expected? I used weights when building my XGB model, I wonder whether that's the issue.

Additionally, I used 100~ish features in my XGB model, but the eli5.show_prediction only shows feature importance of the top 70. What should I do in order to make the program output feature importance for all ~100 features?

Below is the output given by .show_prediction currently:

_y (score -0.329) top features       
Contribution    Feature Value

0.126   feature 1   1844

0.126   feature 3   100

0.108   feature 10  47

0.086   feature 100 100

0.057   feature 20  0

0.043   feature 5   47

0.039   bias    1

0.038   feature 56  0

... more results...
Julio Cezar Silva
  • 2,148
  • 1
  • 21
  • 30
  • If you can, provide a minimal, reproducible example to give us more details on your current implementation and data. – Julio Cezar Silva Aug 15 '20 at 15:02
  • As for the number of features shown, `eli5.show_prediction(top=100)`. From [the docs](https://eli5.readthedocs.io/en/latest/autodocs/eli5.html#eli5.show_prediction) - _`show_prediction()` accepts all [`eli5.explain_prediction()` arguments](https://eli5.readthedocs.io/en/latest/autodocs/eli5.html#eli5.explain_prediction)"_. – Julio Cezar Silva Aug 15 '20 at 15:02

0 Answers0