Specialty Care AI Control Tower
An end-to-end responsible AI product combining governed data engineering, exploratory analysis, supervised and unsupervised learning, deep-learning forecasting, Bayesian inference, controlled retrieval, constrained optimization and production-ready software.
All records, outcomes and notes are synthetic. No patient-identifying data are used.
One governed analytical chain, from source data to human-reviewed decisions
The system is designed as a product rather than a notebook: source contracts feed bronze, silver and gold layers; versioned models generate forecasts, propensity scores, segments and note routes; a mixed-integer optimizer produces a capacity-feasible plan; every result is monitored and traceable.
The project demonstrates the complete AI lifecycle: business translation, information-system understanding, data quality, EDA, supervised and unsupervised learning, deep learning, Bayesian statistics, optimization, LLM/RAG guardrails, cloud-scale patterns, dashboards, deployment, monitoring and responsible AI.
Eight linked stages, one accountable pipeline
Synthetic scale, explicit contracts and an auditable medallion architecture
| Source | Grain / count | Role |
|---|---|---|
| HCP master | 800 | profile, territory, potential, consent |
| HCP-week activity | 83,200 | engagement, stock, access, starts |
| CRM interactions | 74,326 | channel, duration, estimated cost |
| Field notes | 5,000 | controlled routing categories |
| Territory master | 48 | population proxy and access indices |
| Approved KB | 20 | retrieval corpus |
Three interpretable profiles selected quantitatively
Seven standardized profile features are clustered with K-means. Candidate k values from 3 to 6 are compared by silhouette score; k=3 is selected. PCA is used only for visualization.
- Annual starts
- 156.4
- Contacts / week
- 1.24
- Portal sessions / week
- 1.45
- Potential
- 0.748
- Digital affinity
- 0.703
- Response posterior
- 41.0% [39.9%, 42.1%]
Coordinated, consent-aware omnichannel planning.
- Annual starts
- 103.5
- Contacts / week
- 0.89
- Portal sessions / week
- 1.10
- Potential
- 0.496
- Digital affinity
- 0.520
- Access barrier
- 0.397
- Response posterior
- 37.8% [36.9%, 38.7%]
Local access review matters more than contact volume alone.
- Annual starts
- 74.3
- Contacts / week
- 0.57
- Portal sessions / week
- 0.74
- Potential
- 0.269
- Digital affinity
- 0.322
- Response posterior
- 34.7% [33.6%, 35.8%]
Selective, low-cost approved education and follow-up.
Out-of-time propensity scoring with calibration and subgroup review
- ROC AUC
- 0.801
- PR AUC
- 0.712
- Brier score
- 0.185
- Positive rate
- 38.5%
- Top-decile lift
- 2.20x
- Temporal test
- final four months
LightGBM classifier · 160 trees · learning rate 0.05 · max depth 5 · 24 leaves · balanced class weights · standardized numeric features · one-hot specialty, region and segment.
12-week territory forecasting with a transparent challenger and calibrated uncertainty
- Territory-week time split: training through week 79, calibration weeks 80–91, test weeks 92–103.
- LightGBM: Poisson objective, 240 estimators, 18 temporal/operational/geographic features.
- LSTM: global model, 12-week sequences, 8 normalized inputs, hidden size 28, dense 28→14→1 Softplus head.
- Adaptive split-conformal normalized nonconformity quantile q = 0.309.
- Nominal 80% interval empirical coverage 86.6%.
Uncertainty-aware response estimates by segment
Beta(1, 1) prior + Binomial likelihood → Beta(1+y, 1+n-y) posterior
Posterior response probabilities summarize aggregate uncertainty; they do not estimate treatment or engagement uplift.
Useful automation without medical-content overreach
| access_barrier | product_education | logistics | follow_up | safety_question | |
|---|---|---|---|---|---|
| access_barrier | 293 | 1 | 4 | 3 | 0 |
| product_education | 6 | 308 | 3 | 2 | 2 |
| logistics | 8 | 1 | 202 | 4 | 1 |
| follow_up | 6 | 5 | 2 | 270 | 0 |
| safety_question | 2 | 4 | 2 | 5 | 116 |
- 1Note classification
- 2Retrieve approved snippets
- 3Validate evidence IDs
- 4Emit structured JSON
- 5Escalate safety and low-confidence cases
{
"category": "controlled_label",
"summary": "grounded approved statement",
"route": "approved_owner",
"requires_human_review": true,
"evidence_ids": ["DOC-..."]
}- No diagnosis or treatment recommendation.
- No patient-identifying text.
- Approved retrieved text only.
- Safety language always routed to a human-approved channel.
- Prompts, evidence IDs and version retained for audit.
The repository demonstrates a provider-neutral LLM gateway and deterministic fallback without presenting external generated content as validated medical information.
Capacity-feasible next-best-action planning
- Budget cap
- €34,000
- Budget used
- €30,000
- Field capacity
- 110 / 110
- Contact cap
- 350 / 350
- Expected incremental starts
- 42.413
- Field visits
- 12
- Hybrid sequences
- 98
- Remote calls
- 142
- Approved emails
- 0
- None
- 8
maximize Σ_i Σ_a utility(i,a) × x(i,a)
subject to one action per HCP
budget ≤ cap
field units ≤ capacity
contacts ≤ cap
digital actions require consent
x(i,a) ∈ {0,1}Purpose limitation, evidence and human authority by design
| Metric | Value | Threshold | Status |
|---|---|---|---|
| Contacts PSI | 0.00001692 | 0.2 | PASS |
| Forecast WAPE | 0.1500 | 0.18 | PASS |
| Propensity Brier score | 0.1853 | 0.2 | PASS |
| Interval coverage | 0.8663 | 0.75 | PASS |
A deployable model package, not a notebook-only demonstration
GET /health → status + model_version POST /propensity → typed features → probability + decision_support_only=true
- Reproducible fixed-seed pipeline
- Semantic model version
- Data + feature contracts
- Temporal holdouts
- Calibration + conformal coverage
- Fairness by region
- Monitoring dashboards
- PSI drift + coverage checks
- Rollback via registry pin
Every headline metric has a downloadable evidence trail
Green workbook cells are formulas, yellow cells are Python/model outputs and blue cells are editable assumptions.