TeamHG-Memex / eli5

A library for debugging/inspecting machine learning classifiers and explaining their predictions
http://eli5.readthedocs.io
MIT License
2.76k stars 334 forks source link

How to Validate the "show_prediction" Results. #387

Open CDCDM1986 opened 4 years ago

CDCDM1986 commented 4 years ago

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 different expected? I used weight 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 show feature importance of the top 70. What should I do in order to let the program output feature importance for all ~100 features?

_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 1
0.038 feature 56 0

.... more results..._