Use xgboost to categorize a continuous variable, conditional on prediction and other covariates
- Dominant language
- C++
- Stars
- 28.8k
- Forks
- 8.9k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 54
Description
Hello,
I'm doing causal inference using the virtual twins method (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3880775/). The literature on this and similar method focuses on categorical treatments, while in my case I have continuous ones.
To categorize such variables I tested two methods: Either I use a regression tree on the xgboost model predictions to find subsets the maximize the discrimination of the outcome, or, if the tree fails to find useful strata, I categorize the variable using quartiles.
The first method has the problem of not considering the other covariates, even if is trained on the full xgboost model predictions, which do include the effect of all variables, not on the actual dichotomic outcome. The second method instead doesn't even consider the outcome.
Since xgboost internally do split the predictors among the trees, is there a theoretically robust method to use such rules to transform the continuous predictors in a categorical one with as few splits as possible which include information about the outcome and the covariates. A sort of simpler rule produced by collapsing all the xgboost tree rules related to the predictor of interest.
Thanks
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.