Lecture 7 Notes — Prescriptive Analytics
Learning outcome: LO3
Companion files: slides L07, notebook Week7_Prescriptive_Analytics.ipynb
1. From prediction to decision
Prediction says what is likely; prescription says what to do about it. Prescriptive analytics needs three ingredients: decision variables, an objective and constraints.
2. The campaign problem
Choose hotels to feature in a promotion. For hotel i, x_i = 1 if featured.
- Maximise expected extra bookings Σ u_i x_i, with
u_i = 0.1 · n_reviews · (avg_rating / 5)³. - Budget: Σ c_i x_i ≤ B = 25, with costs 2★ = 1.0, 3★ = 1.5, 4★ = 2.5, 5★ = 4.0.
- Diversity: at most 5 hotels per city.
The utility and cost formulas are assumptions invented for teaching; in practice they come from predictive models and finance. State your assumptions explicitly.
3. Three ways to decide
| Plan | Hotels | Cost | Expected extra bookings |
|---|---|---|---|
| Naive (top rated) | 14 | 25.0 | 44.1 |
| Greedy (uplift per cost) | 21 | 24.5 | 69.9 |
| Optimal (MILP) | 21 | 25.0 | 70.8 |
The optimal plan beats the naive plan by 60.7%. Picking the best-rated hotels is not the best plan, because rating ignores cost. Greedy gets within about 1.4% of optimal, but offers no guarantee in general.
4. What-if and shadow prices
Re-solving for budgets from 5 to 80 gives a frontier with diminishing returns: extra bookings climb to about 107 and then flatten (from roughly B = 60), because the per-city cap, not money, becomes the limiting constraint. The shadow price of the budget at B = 25 is about 2.16 bookings per extra unit (from the LP relaxation, valid for small changes). It tells you which constraint is worth negotiating.
5. Robustness by simulation
Utilities are estimates, so perturb them and re-score each plan thousands of times. Optimal: mean 70.9, 5th percentile 61.9. Naive: mean 44.1, 5th percentile 36.1. A "robust" plan that maximises mean − 1 SD produced practically the same result here (mean 70.8, 5th percentile 61.8): robustness pays only when options differ in risk.
6. Overbooking
100 rooms; each booking shows with probability 0.90; a filled room earns 100; each guest we cannot house costs 250. The profit-maximising policy accepts 109 bookings: expected profit 9,640 versus 9,000 with no overbooking (+7.1%). The optimum balances the marginal gain of one more booking against the expected compensation cost.
7. Implementation
scipy.optimize.milp solves mixed-integer linear programs exactly. At cluster scale, split the problem (for example per region) and solve subproblems in parallel, or use a dedicated solver.
8. Discussion questions
- Which constraint would you ask management to relax, and why?
- When is a greedy heuristic good enough?
- What would make the overbooking cost of 250 unrealistic, and how would results change?
Next lecture: survival analysis.