Adapting black-box machine learning methods for causal inference