Data Science, Causal Inference, Machine Learning, Optimization, Notes From Industry.
4].reshape(-1, 1) # Calculate outcome prediction for treated treated = model.predict(df_scoring) return treated, df_scoring We do this for each product: treated_1, df_scoring_1 = extract_treated_effect(n, X_train_1, model_1) treated_2, df_scoring_2 = extract_treated_effect(n, X_train_2, model_2)