Skip to content

CausalForestDML with binary outcome and treatment #779

@kayoungcarmen

Description

@kayoungcarmen

Hi, I'm building a causal forest with binary outcome and binary treatment.
I have sufficient observations (over 100K) for two groups, but the model doesn't seem to work well because const_marginal_ate is -0.00152163 and feature_importances_ returns an array of zeros looking like array([0., 0., 0.,...

Could you let me know a) CausalForestDML is the right method to use for binary outcome and binary treatment and b) the model setting below is correct?

# set variables for causal forest 
Y = train[one variable]
T = train[one variable]
X = train[20 variables]
W = None
X_test = test[20 variables]

# set parameters for causal forest 
est = CausalForestDML(criterion='het',
                                min_impurity_decrease=0.001,
                                n_estimators=1000,       
                                min_samples_leaf=10, 
                                max_depth=None, 
                                max_samples=0.5,
                                discrete_treatment=True,
                                honest=True,
                                inference=True,
                                cv=5,
                                model_t=RandomForestClassifier(random_state=0), 
                                model_y=RandomForestClassifier(random_state=0),
                                )

# Fit the model
est.fit(Y, T, X=X, W=W)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions