agentleFS
afelipegafelipeg/Anthropic-Skills-for-enterprise-marketing-os/skills/response-uplift-modeling/SKILL.md

response-uplift-modeling

Skill1 starsChanged 7 months agoMITView on GitHub

Predicts customer response probabilities (propensity) and incremental lift for promotions, supporting ROI optimization via uplift modeling. Use when the user asks to: predict who will respond to a campaign, score customers for promotion targeting, estimate incremental lift vs control group, optimize promotion ROI by finding the scoring threshold that maximizes profit, evaluate a propensity or uplift model with lift charts or precision-recall curves, or build a two-model / single-model / multinomial uplift approach. Also trigger when someone says "propensity model", "uplift model", "response model", "persuadables", "four quadrants", "incremental lift", "treatment vs control", "ROI threshold", "targeting depth", "decile lift", "savability score", "churn uplift", "capping and budgeting", "campaign ROI optimization", or pastes customer-level data with treatment (T) and response (Y) columns.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only Persuadables deliver positive incremental ROI.

    line 49
  2. Distinctive:

    Test/control split: if uplift modeling is requested

    line 60
  3. Distinctive:

    If no control group exists → default to propensity_logistic only and caveat.

    line 62
  4. Distinctive:

    Run the selected script. Output: score per customer + model metrics.

    line 77
  5. Very specific:

    Run lift_chart.py → compare targeted vs random cumulative response curve

    line 91
  6. Very specific:

    Run pr_curve.py → precision-recall for model quality

    line 92
  7. Very specific:

    After computing results (from scripts or from user-provided data), render a dynamic HTML dashboard using show_widget.

    line 119
  8. Very specific:

    Use the HTML template in references/dashboard_template.html as the base.

    line 127
  9. Distinctive:

    Retention campaigns: use *savability* (−uplift on churn) × LTV as targeting score instead of raw churn propensity (Katsov §3.6.4, eq.

    line 160

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Response & Uplift Modeling

Predictive modeling skill for promotion targeting. Covers propensity scoring, two-model and single-model uplift, multinomial four-quadrant classification, ROI threshold optimization, and evaluation (lift chart, PR curve).

Theoretical Foundation (Katsov Ch. 3)

Response Modeling Framework (§3.4.1)

Expected campaign profit:

G(U) = Σ_{u∈U} [ Pr(R|u,T) · G(u|R) − C ]
     = Σ_{u∈U} E[G|u,T] − C

Selection rule: target customer u iff E[G|u,T] > C
ROI is maximized by finding the propensity threshold where marginal profit = 0 (§3.6.2.2).

Four Response Quadrants (§3.5.4.2, Kane et al. 2014)

GroupT=1T=0Strategy
Persuadables (TR)RespondDon't respondTARGET → highest uplift
Sure Things (CR)RespondRespondSkip — no incremental value
Lost Causes (TN)Don't respondDon't respondSkip — waste budget
Do-Not-Disturb (CN)Don't respondRespondAvoid — treatment harms

Uplift = Pr(R|T,x) − Pr(R|C,x)
Only Persuadables deliver positive incremental ROI.


Workflow

Step 1 — Assess Data

Confirm the dataset has:

  • Profile features (observation window): RFM, behavioral, demographic
  • Treatment indicator T ∈ {0,1}
  • Response label Y ∈ {0,1} (outcome window)
  • Test/control split if uplift modeling is requested

If no control group exists → default to propensity_logistic only and caveat.

Step 2 — Select Model

ObjectiveModelScript
Score all customers by P(response)Propensity (unconditional)propensity_logistic.py
Estimate incremental lift, simpler setupUplift – Two-Modeluplift_two_model.py
Estimate incremental lift, better calibrationUplift – Single Model + interactions (Lo, 2002)uplift_single_model.py
Full quadrant classificationUplift – Multinomialmultinomial_uplift.py
Find optimal targeting depthROI Threshold Optimizerroi_threshold_optimizer.py

→ Read references/model_selection.md for guidance on choosing between two-model vs single-model.

Step 3 — Train & Score

Run the selected script. Output: score per customer + model metrics.

Step 4 — Optimize Threshold (§3.6.2.2)

Run roi_threshold_optimizer.py with:

  • uplift_scores (or propensity scores)
  • promo_cost (C — cost per promotion distributed)
  • response_value (G — net profit per conversion)

Output: optimal score cutoff, targeting depth (% of population), expected ROI at optimum.

Key insight from Katsov §3.6.2.2: Maximum budget ≠ maximum ROI. Targeting beyond the breakeven threshold destroys value. The ROI curve peaks before budget exhaustion.

Step 5 — Evaluate

  • Run lift_chart.py → compare targeted vs random cumulative response curve
  • Run pr_curve.py → precision-recall for model quality
  • Report: Lift at top decile, AUC, breakeven targeting depth

Scripts Reference

ScriptInputsKey Output
propensity_logistic.pyX_train, y_train, X_scorepropensity_score ∈ [0,1] per customer
uplift_two_model.pyX_treat, y_treat, X_ctrl, y_ctrl, X_scoreuplift_score = P(RT,x) − P(RC,x)
uplift_single_model.pyX, T, y, X_scoreuplift_score via interaction terms (Lo, 2002)
multinomial_uplift.pyX, T, y, X_scorePr per quadrant (TR, CR, TN, CN) + uplift
roi_threshold_optimizer.pyscores[], promo_cost, response_valueoptimal_threshold, targeting_depth, max_roi
lift_chart.pyscores[], y_actualLift chart PNG + lift table by decile
pr_curve.pyscores[], y_actualPR curve PNG + AUC-PR

→ Read individual script headers for full parameter documentation.


Output Format — Visualization First

Rule: always render an inline HTML artifact as primary output. Markdown tables are secondary.

Visualization Layer (must-have for every analysis)

After computing results (from scripts or from user-provided data), render a dynamic HTML dashboard using show_widget. The dashboard must include:

  1. Four-Quadrant Map — SVG or canvas showing Persuadables / Sure Things / Lost Causes / Do-Not-Disturb with customer density per quadrant
  2. Lift Chart — dual-line chart (targeted vs random) with decile markers
  3. ROI Curve — cumulative ROI by targeting depth with peak annotated
  4. Score Distribution — histogram of uplift/propensity scores with breakeven line
  5. KPI Summary Bar — top-line metrics: optimal threshold, targeting depth %, expected ROI, lift@decile1

Use the HTML template in references/dashboard_template.html as the base. Pass computed data as inline JSON.

When No Script Output is Available (user pastes data / describes scenario)

Compute values analytically inline (Python in bash_tool or by hand) then render the dashboard with those values. Never output only a markdown table when a visualization is possible.

Output Sequence

1. [bash_tool] Run scripts if data is available → capture JSON output
2. [show_widget] Render HTML dashboard with results
3. [text] 3–5 line executive recommendation
4. [text] Caveats if no control group or small sample

Fallback (if show_widget unavailable)

Produce markdown tables in this order:

  1. Score table (top 10): customer_id | score | decile | quadrant
  2. Lift table (Katsov Table 3.7): decile | responses_random | responses_targeted | lift
  3. ROI table (Katsov Table 3.8): decile | cost | profit_random | profit_targeted | cumulative_roi
  4. Recommendation text

Key Caveats

  • Never present propensity score as uplift. High propensity ≠ high incremental lift. Sure Things inflate propensity models without adding ROI (Katsov §3.5.4.2).
  • Two-model approach risk: separately trained models may have incomparable scales and select non-uplift-predictive features (Radcliffe & Surry, 2011).
  • Uplift variance: uplift = difference of two random variables → higher variance than propensity. Requires larger pilot sample for reliable estimates.
  • Retention campaigns: use savability (−uplift on churn) × LTV as targeting score instead of raw churn propensity (Katsov §3.6.4, eq. 3.40).

Reference Files

  • references/model_selection.md — When to use two-model vs single-model vs multinomial
  • references/katsov_ch3_excerpts.md — Key equations and tables from Katsov Ch. 3
  • references/roi_optimizer_math.md — Full derivation of ROI threshold formula
  • references/dashboard_template.html — Reusable HTML artifact with lift chart, ROI curve, quadrant map, score distribution. Load this and substitute SKILL_DATA_JSON placeholder with computed results.

Integration with Agency Growth OS

Upstream skillHandoff
audience-segmentation-briefSegment-level propensity models (Katsov §3.5.5)
measurement-incrementalityUplift scores as incrementality proxy pre-experiment
crm-journey-architectSavability scores feed retention journey triggers
margin-simulationroi_threshold_optimizer.py output feeds margin model
media-routing-plannerChannel-level response rates for budget allocation

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.