add subgroup analysis to hillstrom#101
add subgroup analysis to hillstrom#101yasui-salmon wants to merge 2 commits intoCyberAgentAILab:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new “Subgroup Analysis by Purchase History” section to the Hillstrom tutorial to illustrate heterogeneous campaign effects by prior purchase category, along with supporting visualization assets.
Changes:
- Introduces subgroup definitions based on
mens/womenspurchase history and computes subgroup ATE/DTE/PTE comparisons. - Adds narrative interpretation and new plots for subgroup DTE/PTE results.
- Adds a static image asset used by the new tutorial section.
Reviewed changes
Copilot reviewed 1 out of 6 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docs/source/tutorials/hillstrom.rst | Adds subgroup ATE/DTE/PTE walkthrough and embeds subgroup plot images. |
| docs/source/_static/hillstorm_subgroup_women_pte.png | Adds the subgroup PTE plot image referenced by the tutorial. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Beyond comparing email campaigns overall, we can examine how campaign effectiveness varies by customer purchase history. This analysis segments customers based on their past purchasing behavior: | ||
|
|
||
| - **Male Purchaser Segment** (``mens=1``): Customers who previously purchased men's merchandise (35,266 customers, 55.1%) | ||
| - **Female Purchaser Segment** (``womens=1``): Customers who previously purchased women's merchandise (35,182 customers, 55.0%) | ||
|
|
There was a problem hiding this comment.
The subgroup labels "Male Purchaser Segment" / "Female Purchaser Segment" are misleading here: the mens / womens columns indicate prior purchases in men's/women's merchandise categories, not customer gender. Consider renaming the text to "Men's merchandise purchasers" and "Women's merchandise purchasers" to avoid confusion for readers.
| # Define subgroup masks based on purchase history | ||
| male_purchasers = (df['mens'] == 1) | ||
| female_purchasers = (df['womens'] == 1) | ||
|
|
There was a problem hiding this comment.
In the code block, the mask variables are named male_purchasers / female_purchasers, but they actually represent purchasers of men's/women's merchandise categories. Renaming these variables to something like mens_purchasers / womens_purchasers would make the example clearer and consistent with the underlying columns.
| @@ -0,0 +1,783 @@ | |||
| { | |||
There was a problem hiding this comment.
There's a typo in the filename, can we rename this to hillstorm.ipynb?
TomeHirata
left a comment
There was a problem hiding this comment.
LGTM once comments are addressed!
Add subgroup analysis to hillstrom tutorial.