# Heterogeneous Treatment Effect with Trained Kernels of the Nadaraya-Watson Regression
## 4 The TNW-CATE Description
CATE for a point \(\mathbf{x}=\mathbf{z}\) is defined as a weighted linear combination of the functions \(\tau_{1}(\mathbf{z})\) and \(\tau_{0}(\mathbf{x})\) as \(\tau(\mathbf{x})=\varkappa\tau_{0}(\mathbf{x})+(1-\varkappa)\tau_{1}(\mathbf{ x})\), where \(\varkappa\in[0,1]\) is a weight which is equal to the ratio of treated patients [13]. #### 5.1.2 Base Models for Implementing Estimators

Two models are used as the base regressors \(g_{0}(\mathbf{x})\) and \(g_{1}(\mathbf{z})\), which realize different CATE estimators for comparison purposes. 1. The first one is the random forest. It is used as the base regressor to implement the other models for two main reasons. First, we consider the case of the small number of treatments, and usage of neural networks does not allow us to obtain the desirable accuracy of the corresponding regressors. Second, we deal with tabular data for which it is difficult to train a neural network and the random forest is preferable. Parameters of the random forests used in the experiments are as follows: * Numbers of trees are 10, 50, 100, and 300; * Depths are 2, 3, 4, 5, 6, and 7; * The smallest values of examples which fall in a leaf are 1 example, 5%, 10%, and 20% of the training set. The above values for the hyperparameters are tested, choosing those leading to the best results. 2. The second base model used for realization different CATE estimators is the Nadaraya-Watson regression with the standard Gaussian kernel. This model is used because it is interesting to compare it with the proposed model that is also based on the Nadaraya-Watson regression but with the trainable kernel in the form of the neural network of the special form. Values \(10^{i}\), \(i=-8,\ldots,10\), and values 0.5, 5, 50, 100, 200, 500, and 700 of the bandwidth parameter \(\gamma\) are tested, choosing those leading to the best results. We use the following notation for different models depending on the base models and learners:

* **T-RE, S-RF, and X-RF** are the T-learner, the S-learner, and the X-learner with random forests as the base regression models;
* **T-NW, S-NW, and X-NW** are the T-learner, the S-learner, and the X-learner with the Nadaraya-Watson regression using the standard Gaussian kernel as the base regression models. #### 5.1.3 Other Parameters of Numerical Experiments

The mean squared error (MSE) as a measure of the regression model accuracy is used. For estimating MSE, we perform several iterations of the experiments such that each iteration is defined by the randomly selected parameters of experiments. MSE is computed by using 1000 points. In all the experiments, the number of treatments is 10% of the number of controls. For example, if 100 controls are generated for an experiment, then 10 treatments are generated in addition to controls such that the total number of examples is 110. After generating the training examples, their responses \(y\) are normalized, but the corresponding initial mean and the standard deviation of responses are used to normalize responses of the test examples. This procedure allows us to reduce the variance among results at different iterations. The generated feature vectors in all experiments consist of 10 features. To select optimal hyperparameters of all regressors, additional validation examples are generated such that the number of controls is 20% of the training examples from the control group. #### 5.1.4 Functions for Generating Datasets

The following functions are used to generate synthetic datasets:

1. **Spiral functions:** The functions are named spiral because when using two features vectors they are located on the Archimedean spiral.