How to output treatment for predicted CATE using CausalForest using DoWhy in python? I am new to Causal Inference but working on my first project. In this project I have a continuous treatment such as discount%.  My outcome or Y is the purchase_amount. Thus, I defined my vars as:
y = purchase_amount
T = discount% (0,5,10)
X = some covariates
W = some confounders

I found an article (https://towardsdatascience.com/causal-machine-learning-for-econometrics-causal-forests-5ab3aec825a7) which uses CausalForest to estimate CATE for a given treatment on a user basis. However, when I run the model, I get output such as:
User_id | CATE
1       | -0.2
2       |  0.21
..

Given this code snippet:
from econml.dml import CausalForestDML
from sklearn.linear_model import MultiTaskLassoCV

    # set parameters for causal forest 
    causal_forest = CausalForestDML(criterion='het', 
                                    n_estimators=10000,       
                                    min_samples_leaf=10, 
                                    max_depth=None, 
                                    max_samples=0.5,
                                    discrete_treatment=False,
                                    honest=True,
                                    inference=True,
                                    cv=10,
                                    model_t=MultiTaskLassoCV(), 
                                    model_y=MultiTaskLassoCV(),
                                    )
                          
    # fit train data to causal forest model 
    causal_forest.fit(Y, T, X=X, W=W)
    # estimate the CATE with the test set 
    causal_forest.const_marginal_ate(X_test)

Given my output above, how do I know for which treatment value these CATEs are? For example, if we have 3 discounts (0%, 5%, 10%) and I predict a user's CATE of -0.2, does that apply for 0%, 5%, or 10%? It is not clear to me how I can identify this. I hope someone can help.
 A: First, the model CausalForestDML presumes that the outcome Y depends linearly on the treatment T. That means this relation is independent of the treatment T. The proportionality factor $\theta(\mathbf X)$ (the "effect") depends solely on the feature covariates $\mathbf X$. Thus, it is the same for all your three discounts (0%, 5%, 10%).
Second, in your code you ask for the const_marginal_ate(), which is $E_{\mathbf X}[\theta(\mathbf X)]$, i.e. it is the average over all possible feature covariates $\mathbf X$ and thus doesn't even depend on $\mathbf X$ anymore.
Third, in this model, you can have multiple treatments $\mathbf T$, and multiple outcomes $\mathbf Y$, and for each treatment-outcome pair, you can compute the constant marginal ATE. Thus, you have a matrix of effects. But from your post, I could not figure out whether this is the case in your situation. It seems like you have just one treatment variable discount%, which can take on three possible values (0%, 5%, 10%), and only one outcome variable purchase_amount, in which case the return type of const_marginal_ate() should be a scalar, see the part Returns in the documentation.
I am also not sure about your posted output table: on the one hand, you say you compute the constant marginal ATE (because you use const_marginal_ate()), but on the other hand the column header in your posted output table is CATE. And maybe the column header User_id is your covariate W, but this is also not clear.
Summary: In general, for d_y outcomes Y and d_t treatments T, the result of const_marginal_ate() is a d_y x d_t matrix $M$, constant in the particular values of the treatments and of the covariates X, which gives in each cell $M_{ij}$ the effect of the $j$-th treatment on the $i$-th outcome.
