Algorithm 1 Estimating and Evaluating an Individualized Treatment Rule (ITR) using the Same Experimental Data via Cross-Validation
Steps in Algorithm 1 | Function/object | Output |
---|---|---|
1. Split data into K random subsets of equal size (Z1, ⋯, Zk) | caret::createFolds() within
estimate_itr() |
dataframe |
2. k ← 1 | ||
3. while k ≤ K do | for loop in fit_itr() within
estimate_itr() |
|
4. Z−k = [Z1, ⋯, Zk − 1, Zk + 1, ⋯, ZK] | trainset object |
training data |
5. f̂−k = F(Z−k) | modulized functions for each ML algoritms (e.g.,
run_causal_forest() ) within
estimate_itr() |
ITR (binary vector) |
6. τ̂k = τ̂f̂−k(Zk) | compute_qoi() function within
evaluate_itr() |
metrics for fold k |
7. k ← k + 1 | ||
8. end while | ||
9.return $\hat{\tau}_F=\frac{1}{K} \sum_{k=1}^K \hat{\tau}_k$, $\widehat{\mathbb{V}\left(\hat{\tau}_F\right)}=v\left(\hat{f}_{-1}, \cdots, \hat{f}_{-k}, \mathbf{Z}_1, \cdots, \mathbf{Z}_K\right)$ | PAPEcv() PAPDcv() and
getAupecOutput() functions inside
compute_qoi() function within
evaluate_itr() |
averaging the results across folds |