Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behavior between dowhy wrapper and wrapped model #856

Open
kbattocchi opened this issue Feb 28, 2024 · 0 comments
Open

Inconsistent behavior between dowhy wrapper and wrapped model #856

kbattocchi opened this issue Feb 28, 2024 · 0 comments

Comments

@kbattocchi
Copy link
Collaborator

For some reason the trained T and Y models exposed by the dowhy wrapper do not accept input of the correct shape, seeming to expect twice as many X columns as they should (e.g. with 3 X columns and 5 W columns, the error message will complain that 8 columns were supplied but 11 were expected):

model_dml = LinearDML(model_y=LinearRegression(),
                      model_t=LinearRegression())

d_x = 2
d_w = 5

N_SHAPE = 1000
Y = np.random.normal(size=N_SHAPE)
T = np.random.randint(2, size=N_SHAPE)
X = np.random.normal(size=(N_SHAPE, d_x))
W = np.random.randint(2, size=(N_SHAPE, d_w))

model_dml = model_dml.fit(Y=Y, T=T, X=X, W=W, inference='auto', cache_values=False)
model_dml_dowhy = model_dml.dowhy.fit(Y=Y, T=T, X=X, W=W, inference='auto', cache_values=False)

# works
model_dml.models_y[0][0].predict(np.concatenate((X, W), axis=1))

# This will error!
model_dml_dowhy.models_y[0][0].predict(np.concatenate((X, W), axis=1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant