File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -372,6 +372,14 @@ def estimate_control_treatment(self) -> tuple[pd.Series, pd.Series]:
372
372
x ["1/" + t ] = 1 / x [t ]
373
373
for a , b in self .product_terms :
374
374
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 )
375
383
x = x [model .params .index ]
376
384
377
385
y = model .get_prediction (x ).summary_frame ()
@@ -453,6 +461,8 @@ def _run_linear_regression(self) -> RegressionResultsWrapper:
453
461
cols += [x for x in self .adjustment_set if x not in cols ]
454
462
treatment_and_adjustments_cols = reduced_df [cols + ["Intercept" ]]
455
463
outcome_col = reduced_df [list (self .outcome )]
464
+ print ("train_data" )
465
+ print (treatment_and_adjustments_cols )
456
466
for col in treatment_and_adjustments_cols :
457
467
if str (treatment_and_adjustments_cols .dtypes [col ]) == "object" :
458
468
treatment_and_adjustments_cols = pd .get_dummies (treatment_and_adjustments_cols , columns = [col ], drop_first = True )
You can’t perform that action at this time.
0 commit comments