This case study offers a walkthrough of the solution using 12 months of historical HCP engagement and prescription data across 500 healthcare professionals, 5 channels, and 50 territories.

## User Story

This solution supports two primary user stories:

**Story 1 - Weekly HCP Prioritization & Next Best Action**
Sales representatives and marketing operations teams receive a weekly ranked list of HCPs, each with a recommended channel, grounded in predicted engagement probability and expected Rx impact. Contact frequency rules and opt-out constraints are enforced automatically. Each recommendation includes an AI- generated briefing covering the HCP's commercial profile, the key drivers behind the recommendation, and a rep-ready summary usable directly in call preparation.

**Story 2 - Explainability & Continuous Improvement**
Commercial excellence and data science teams can configure business constraints without code changes, monitor weekly budget utilization and channel distribution, and run what-if scenarios to test alternative budget allocations before committing to a plan.

## [Data](article:11)

The solution uses five input datasets covering 12 months of historical HCP engagement and prescribing activity.

- An **engagement history** dataset of over 11,000 rows covering all HCP  contact attempts across five channels with binary engagement outcomes (successful / not successful)
- A **KPI / Rx metrics** dataset of 26,000 rows covering weekly prescription volume per HCP, used to compute HCP commercial value and prescribing trends
- An **HCP master** dataset of 500 distinct HCPs spanning five specialties (primary care, cardiology, dermatology, endocrinology, oncology), 50 territories, and four practice types
- An **engagement action catalog** of 5 channels with cost-per-action (CPA) and channel uplift coefficients reflecting field and media budget structures
- A **business constraints** dataset of 14 parameters covering weekly budgets, channel volume caps, per-HCP contact limits, and minimum days between contacts

For production deployments it is recommended to collect 18–24 months of data.

---

## Insights

Leverage ML models to automate the selection of the best HCPs to contact  and the optimal channel for each, with expected Rx lift estimates grounding  every recommendation in commercial value. With NBA, pharma commercial teams can shift focus from channel-centric outreach (everyone gets email) to HCP-centric engagement - ensuring that each interaction is higher quality, better timed, and more likely to generate a meaningful response.
Following the template structure of this solution, commercial teams can  quickly configure business constraints, replace input data, and run the full pipeline to generate a production-ready weekly action plan without requiring data science intervention after initial setup.

---

## Step 1 [Feature Engineering](article:12)

Starting from raw engagement history and Rx data, the solution computes over 30 features per HCP × channel combination using rolling time windows that strictly respect temporal order, ensuring no future data leaks into model inputs. Features capture channel engagement patterns (attempt and success counts over 1, 4, and 12-week windows), prescribing trends (weekly Rx volume, 4-week and 8-week rolling averages, trend direction), and HCP profile attributes (specialty, segment, practice type, account tenure).

---

## Step 2 [Machine Learning](article:14)

A single Gradient Boosting classifier predicts the probability of successful engagement for each HCP × channel pair, trained on actual historical engagement events. The model produces one score per HCP × channel combination - ranking all feasible actions before the optimizer runs. Each prediction is accompanied by SHAP feature attributions that feed directly into the explainability layer.

---

## Step 3 [Optimization](article:3)

A Mixed Integer Linear Programming (MILP) optimizer selects one action per HCP per cycle, maximizing total expected Rx impact across the full HCP population within weekly budget and capacity constraints. Expected impact combines engagement probability, HCP prescribing volume, and channel uplift into a single ranking metric that the optimizer can act on. The solver respects all hard constraints, including opt-out flags, channel caps, and minimum days between contacts.

---

## Step 4 [Explainability & Rep-Facing Summaries](article:16)

SHAP values from the ML model are translated into plain-English justifications using an LLM recipe. Each recommendation carries three outputs: a commercial HCP profile summary, 3–5 justification bullets labeled by contribution strength, and a rep-ready guidance paragraph usable directly in call preparation or CRM notes. All outputs respect promotional guardrails - no causal language, no ML references, no competitor mentions.

---

## Step 5 [Dashboards](article:31) & [Webapp](article:32)

Three persona-specific views surface the weekly output:

- **Sales Rep / Marketing Ops webapp** - filterable priority table with HCP detail panel showing recommendation, Rx trends, engagement history, and AI justification sections
- **Territory Manager dashboard** - territory summary table, coverage gap detection, channel mix analysis, and territory performance scatter plot
- **Commercial Excellence dashboard** - budget utilization, channel efficiency, expected impact by specialty and practice type, and a what-if scenario tool for budget planning

---

## Step 6 [NBA Action Assistant](article:6)

The solution includes a conversational AI agent that guides sales reps and marketing operations teams through the full weekly engagement cycle. The agent supports HCP discovery, profile retrieval, recommendation
explanation, compliant email drafting, and CRM logging - all within a single interface. A compliance knowledge base is embedded in the agent, enabling reps to check approved claims, channel rules, and fair balance requirements before sending any communication. Human-in-the-loop controls ensure no email is sent without explicit rep confirmation.

---

## Conclusion

The NBA for Pharma solution delivers an end-to-end weekly planning and execution experience - from raw data to ranked recommendations, AI-generated rep briefings, and a conversational agent that supports the full outreach cycle. Commercial teams gain a shared, data-driven view of HCP priorities, replacing intuition and spreadsheets with transparent, auditable recommendations grounded in engagement history and prescribing behavior. The result is a measurable improvement in outreach quality, rep productivity, and commercial resource allocation - with a compliance layer built in from the start.