Data Science, Causal Inference, Machine Learning, Optimization, Notes From Industry.
treatment effect for the full range of treatment values (discount amount) whilst holding other features to their mean value. We start by extracting the expected outcome (number of orders) for the full range of treatment values: def extract_treated_effect(n, X_train, model): # Set features to mean