Skip to content

add subgroup analysis to hillstrom#101

Open
yasui-salmon wants to merge 2 commits intoCyberAgentAILab:mainfrom
yasui-salmon:feat/tutorials/hillstrom
Open

add subgroup analysis to hillstrom#101
yasui-salmon wants to merge 2 commits intoCyberAgentAILab:mainfrom
yasui-salmon:feat/tutorials/hillstrom

Conversation

@yasui-salmon
Copy link
Copy Markdown

Add subgroup analysis to hillstrom tutorial.

Copilot AI review requested due to automatic review settings April 20, 2026 11:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/womens purchase 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.

Comment on lines +338 to +342
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%)

Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yasui-salmon I think this comment is legit

Comment on lines +352 to +355
# Define subgroup masks based on purchase history
male_purchasers = (df['mens'] == 1)
female_purchasers = (df['womens'] == 1)

Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread docs/source/tutorials/hillstrom.rst
Comment thread docs/source/tutorials/hillstrom.rst
Comment thread example/hillstrom.ipynb
@@ -0,0 +1,783 @@
{
Copy link
Copy Markdown
Collaborator

@TomeHirata TomeHirata Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo in the filename, can we rename this to hillstorm.ipynb?

Copy link
Copy Markdown
Collaborator

@TomeHirata TomeHirata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once comments are addressed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants