EconML icon indicating copy to clipboard operation
EconML copied to clipboard

SHAP Values and DynamicDML yields IndexError: list index out of range

Open nmwitzig opened this issue 1 year ago • 0 comments

Hi everyone,

If we do the example from the DynamicDML class

from econml.panel.dml import DynamicDML

np.random.seed(123)

n_panels = 100  # number of panels
n_periods = 3  # number of time periods per panel
n = n_panels * n_periods
groups = np.repeat(a=np.arange(n_panels), repeats=n_periods, axis=0)
X = np.random.normal(size=(n, 1))
T = np.random.normal(size=(n, 2))
y = np.random.normal(size=(n, ))
est = DynamicDML()
est.fit(y, T, X=X, W=None, groups=groups, inference="auto")

and then do shap_values = est.shap_values(X)

we get an IndexError IndexError: list index out of range

Im using econml in version 0.14.1 (the problem persists in 0.15.0b1)

Thank you!

nmwitzig avatar Dec 19 '23 10:12 nmwitzig