I am trying to rebuild Random assignment, binary CATE example for my dataset. Coming to ct.fit(data=cd, outcome=cd.outcomes[0])
I get the error TypeError: fit() missing 2 required positional arguments: 'treatment_name' and 'outcome_name'
Everything before that runs without any problems
This is the codeblock:
ct = CausalTune(
estimator_list=estimator_list,
metric=metric,
verbose=0,
components_verbose=0,
time_budget=time_budget,
components_time_budget=components_time_budget,
train_size=train_size
)
# run causaltune
ct.fit(data=cd, outcome=cd.outcomes[0])
print('---------------------')
# return best estimator
print(f"Best estimator: {ct.best_estimator}")
# config of best estimator:
print(f"Best config: {ct.best_config}")
# best score:
print(f"Best score: {ct.best_score}")
After preprocessing my dataset looks like this: (with successful being the outcome and treatment being the treatment)
treatment | successful | random | NumberOfTerms | MonthlyCost | CreditScore | OfferedAmount |
---|---|---|---|---|---|---|
0 | 0 | 0.0 | 22.0 | 241.279999 | 0.0 | 5000.0 |
0 | 0 | 0.0 | 22.0 | 241.279999 | 0.0 | 5000.0 |
0 | 0 | 1.0 | 22.0 | 241.279999 | 0.0 | 5000.0 |
0 | 0 | 1.0 | 22.0 | 241.279999 | 0.0 | 5000.0 |
0 | 0 | 1.0 | 22.0 | 241.279999 | 0.0 | 5000.0 |
Does anyone know of a solution?
I do not know why this error occurs, I tried using different estimators but that does not fix the issue. Printing cd.outcomes[0]
gives successful
so the error does not seem to lie there.