Skip to content

Commit d1817b4

Browse files
committed
Runs but not clean
1 parent df15faa commit d1817b4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

causal_testing/testing/estimators.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,14 @@ def estimate_control_treatment(self) -> tuple[pd.Series, pd.Series]:
372372
x["1/" + t] = 1 / x[t]
373373
for a, b in self.product_terms:
374374
x[f"{a}*{b}"] = x[a] * x[b]
375+
print("full")
376+
print(x)
377+
for col in x:
378+
if str(x.dtypes[col]) == "object":
379+
x[col] = [v.value for v in x[]]
380+
x = pd.get_dummies(x, columns=[col], drop_first=True)
381+
print("dummy")
382+
print(x)
375383
x = x[model.params.index]
376384

377385
y = model.get_prediction(x).summary_frame()
@@ -453,6 +461,8 @@ def _run_linear_regression(self) -> RegressionResultsWrapper:
453461
cols += [x for x in self.adjustment_set if x not in cols]
454462
treatment_and_adjustments_cols = reduced_df[cols + ["Intercept"]]
455463
outcome_col = reduced_df[list(self.outcome)]
464+
print("train_data")
465+
print(treatment_and_adjustments_cols)
456466
for col in treatment_and_adjustments_cols:
457467
if str(treatment_and_adjustments_cols.dtypes[col]) == "object":
458468
treatment_and_adjustments_cols = pd.get_dummies(treatment_and_adjustments_cols, columns=[col], drop_first=True)

0 commit comments

Comments
 (0)