Skip to content

Instantly share code, notes, and snippets.

View rahasayantan's full-sized avatar

TheFox rahasayantan

  • Bangalore, India
View GitHub Profile
@cheevahagadog
cheevahagadog / extract_feature_effect_per_prediction.py
Last active November 17, 2020 05:36
Builds off the SHAP package to list out the feature effects per row on an XGBoost model.
#!/usr/bin/env python
# Python 3.6.4
import numpy as np
import pandas as pd
import iml
import xgboost
import shap
from tqdm import tqdm