Open kenneth-lee-ch opened 2 years ago
Sorry for the slow response. For 1) and 3), one goal of the class is to automate model-fitting so that users don't need to manage the fitting process themselves; as a result, we don't provide a way to vary the model-fitting process so there's unfortunately no way to override these as a user. If you have a use case you can share where our existing parameter ranges aren't good enough, we could consider widening them, but given the purpose of the class it is unlikely that we will support ways for the user to manipulate the models in any fine-grained way.
For your other questions, here's the basic idea: we are fitting one heterogeneous treatment effect model per "feature" (i.e. individual entry in feature_inds
) where we consider that feature as a treatment T, the heterogeneity features corresponding to that feature as features X (which can affect the outcome, the treatment, and the strength of the treatment effect), and the rest of the dataset (whether or not they are included as other elements of feature_inds) as controls W (which can affect the level of the treatment or outcome, but not the strength of the treatment effect itself). (See https://econml.azurewebsites.net/spec/api.html for our general heterogeneous treatment effect setup in terms of Y, T, X, and W).
There is nothing wrong with including the same columns in both feature_inds
and heterogeneity_inds
; we always remove the column being considered as a feature from the set of heterogeneity features if necessary when building its model. Correlated or irrelevant controls should not be a problem for correctness (although estimates will be more accurate if irrelevant controls are not included); the main problem to be aware of would be including a downstream effect of a feature as a control (e.g. if you have raw age and quantized age, then putting raw age in feature_inds
while having the quantized age as another column in your dataset would give hard-to-interpret results because we're controlling for something which is downstream of our treatment).
This is intended to represent a limited but easy-to-interpret causal graph, so we don't model feature interactions; we are just computing the direct effect of each feature one-by-one on the outcome.
Hope that helps, and let us know if there is still anything unclear.
@kbattocchi , thank you! I have some follow-up questions.
CausalAnalysis
class only becomes causalForestDML
when I set heterogeneity_model="forest"
?Animal
with dogvcat
and dogvrat
, but I don't see ratvcat
, how should I interpret this?_causal_effect()
do have that same interpretation, of a linear effect of the treatment on the outcome.heterogeneity_model
is "linear" (the default), or CausalForestDML if it is "forest".categories
argument, where the first category in that column's list will be treated as the control), because effects can only be identified relatively, not in absolute terms for each category. You can compute the values of any transition that you care about from the ones that you already have: ratvcat
would be dogvcat-dogvrat
(going from rat to cat is the same as going from rat to dog and then from dog to cat, and rat to dog is the negative of dog to rat).@kbattocchi Thank you for your answer. I think what's left unclear to me still is question 3. How does causal forest know which one is the untreated group vs treated group when it comes to continuous treatment variables for estimating the heterogenous treatment effects within each leaf?
@kbattocchi Hi Keith, do you have a github example on how to apply causal analysis on a df please? it is unclear
I have some questions about the causal analysis class in econML.
Does anyone know how to overcome this issue when I fit the model with the training data. I don't know where I can increase the number of iterations in this class:
Does the causal analysis compute the causal effect of each covariate that has been passed to
feature_inds
one by one, meaning that the first covariate on that list will be used as treatment first and then rest will be controls and repeat the same process for every covariate that has been passed intofeature_inds
? How does that work?How can you change the hypermeter that the model get fine-tuned on so that it can include wider range?
What is the difference if I don't include certain features into
feature_inds
, will they still be used in the model?How is
heterogeneity_inds
different thanfeature_inds
in the model? What if I include some of theheterogeneity_inds
intofeature_inds
?I know that the class uses
causalforestDML
at some points, is it ok to includes features in the data that is not controls between treatments and outcomes? Also, will it be problematic to include variables that are highly correlated?How does the model handle the potential interaction effects of the features?