Prescriptive Modeling

A hospital has two heart valves and one patient. A prescriptive model picks the valve with the lower chance of a pacemaker. Add scans and reports, and one lecture result doubles from 21.09% to 42.89%.

Learn how a model chooses a treatment for each person, from data in which every person got only one treatment.

Flip between the table alone and the table plus reports and scans, then switch the model. Watch the improvement bars move. Then we build, piece by piece, everything underneath: the missing outcomes, the neural network, and the tree that explains it.

You need a feel for averages (add up, divide by the count) and the idea of a neural network that outputs probabilities. We teach the rest inline.

Based on Week 12.1 of MIT MMAI: Multimodal AI (Spring 2026, Paul Liang, MIT Multisensory Intelligence group), with the lecture deck on Prescriptive Neural Networks by Dimitris Bertsimas, Lisa Everest and Vasiliki Stoumpou. Lecture slides (PDF). Every idea is re-taught here in our own words and devices.

Prescribe a heart valve

Numbers are the lecture's TAVR table (2,127 patients, binary choice between the EVOLUT PRO and SAPIEN 3 valve, goal: fewer permanent pacemakers), row "Multimodal" counterfactual estimator, mean improvement with its spread over many random 50/50 splits. Bars are drawn to scale.

Chapter 0

One Patient, Many Possible Treatments

See why choosing a treatment for one person is a different job from predicting what will happen to them

A woman with type 2 diabetes sits in a clinic. Her doctor can start one of several drugs. The doctor can also pick the dose. Each choice changes her HbA1c, a blood test that tracks average blood sugar over about three months. A lower number is better.

The doctor asks three questions. Which medication? What dosage? Should we intervene at all? Those are the three questions on the first slide of the lecture, and the whole lesson answers them with data.

Many models already predict. Give a model her age, her records and her scans, and it says "your HbA1c will be 7.4 in three months". That is useful. But the doctor does not need a forecast. The doctor needs a choice: the drug and the dose that give her the best number.

A choice, not a forecast

Computer scientists call a model that picks an action a prescriptive model. A predictive model says what will happen. A prescriptive model says what to do, so that what happens is as good as it can be. The lecture, taught by Paul Liang in MIT’s Multisensory Intelligence group, spends its session on one prescriptive method and the thinking behind it.

The lecture names the target the optimal prescription problem. In its own words: what treatment do I prescribe a given individual to optimize a specific outcome? Three kinds of ingredient appear on the slide.

  1. Observational data, written {xi} for patients i = 1 to n. Each xi holds everything known about one patient: demographics, current prescriptions, medical data, notes, images, time series. “Observational” means nobody ran an experiment. Doctors treated patients as they saw fit, and we recorded it.
  2. Treatments, written t from a set T. A treatment can be a single yes or no (give the drug or not), one pick from several drugs, one continuous number such as a price, or several continuous numbers at once, such as doses of metformin, insulin and oral blood glucose agents.
  3. Outcomes, written {yi}. The outcome is the number we want to push in one direction. For the diabetes example it is the patient’s HbA1c.

The slide ends with the problem in one line, marked as a minimisation. For a given observation xi, what is the optimal treatment t that minimizes the outcome yi? When a higher outcome is better, as with revenue, you flip the sign and maximise instead.

Why one drug for everyone is not enough

Why not find the single best treatment and give it to all patients? Because the best treatment often depends on the patient. A drug that helps a mild case may do harm in a severe one. When that is true, a rule that looks at the patient beats any rule that ignores them.

Try it. Below, two treatments have an outcome that depends on how ill the patient is. The outcome here is the chance of a bad event, so lower is better. Slide the severity and pick a treatment for each patient.

Choose for this patient

Each line shows the chance of a bad outcome under one treatment. Drag the severity to move the patient. The strip at the bottom shows which treatment is lower at every severity.

0.25

Illustrative toy curves, not patient data: treatment 1 gives 0.20 + 0.60 × severity, and treatment 2 gives 0.62 − 0.35 × severity squared. Averages are taken over 400 evenly spaced severities.

Look at the three averages in the read-out. Giving everyone treatment 1 averages 0.500. Giving everyone treatment 2 averages 0.503. Choosing per patient averages about 0.382. Neither blanket rule comes close, because each one is wrong for roughly half the patients. The personalised rule is the prize.

Why this is hard

In the toy device you could see both curves at once. In real life you cannot. Each real patient received one treatment and has one outcome. We never see what would have happened under the other drugs. Chapters 3 and 4 face that gap directly, and it is the heart of the whole subject.

The lecture then walks four steps, in order. First turn messy inputs into numbers (embeddings). Second, fill in the outcomes we never saw (counterfactuals). Third, train a neural network that picks treatments. Fourth, copy that network into a small tree that a person can read. Each step has its own chapters.

One note on logistics. The lecture sits in Week 12 of the course, on 21 April 2026, under the heading “Prescriptive modeling: optimization and prediction, causal and counterfactual”. It lists no assigned readings. We cite the sources the deck itself names, in the chapters where they matter.

The road

  1. Four routes to a prescription: regress and compare, causal methods, trees, neural networks.
  2. From messy records to numbers: embeddings for tables, notes and scans.
  3. The table with missing cells: counterfactuals and the rewards matrix.
  4. Filling the table fairly: the direct method, propensity scores and doubly robust estimates.
  5. The network and its loss: softmax, expected outcome, and why a hard pick cannot learn.
  6. Train it yourself: the worked example and a live training loop.
  7. The tree that mirrors the network: interpretability on demand.
  8. Six experiments: how to score a prescription, and what the numbers say.
  9. The whole lecture on one page: numbers, code and where to go next.
A model predicts each patient’s HbA1c very accurately under the drug they were given. Why does that not yet tell a doctor which drug to prescribe?

Chapter 1

Four Routes to a Prescription

Compare the main ways to turn observational records into a treatment rule, and see where a neural network fits

Imagine four doctors in a corridor, all handed the same hospital records. They each want a rule that says, for any new patient, which treatment to give. The first doctor builds one forecasting model per drug. The second studies how much each drug helps different kinds of people. The third writes a short flowchart. The fourth trains a neural network. The lecture’s fourth slide lists exactly these four routes.

Route 1: regress and compare

A regression model learns to predict a number from inputs. Here the number is the outcome and the inputs are the patient’s facts. Regress and compare trains one regression model for each treatment. Each model learns only from patients who got that treatment.

For a new patient, you ask every model the same question: what would your outcome be under your treatment? You then compare the answers and choose the lowest. That is the whole method. The lecture cites it three times, including Bertsimas and Kallus on moving from predictive to prescriptive analytics.

The data flow is short. In: a table X with n rows (patients) and d columns (facts), a column t saying which treatment each patient got, and a column y with the outcome. Out: one function ft per treatment, each mapping d numbers to one predicted outcome.

python
from sklearn.ensemble import GradientBoostingRegressor

models = {}
for t in treatments:                       # one model per treatment
    rows = (T == t)                        # only patients who received t
    models[t] = GradientBoostingRegressor().fit(X[rows], y[rows])

def prescribe(x_new):                      # compare, then pick the lowest
    pred = {t: m.predict([x_new])[0] for t, m in models.items()}
    return min(pred, key=pred.get)

The idea is simple and it often works. The weak spot is the word “only” in the code. Each model sees one slice of the patients. If sicker patients mostly got treatment 2, then the model for treatment 2 has little data on mild patients, and its guess for them is poor. Play with that below.

Regress, then compare

Dots are patients, each seen under only one treatment. Lines are the two fitted models. The strip shows which treatment the models pick, and a thin line below shows which is truly better. Raise the steering and watch the picks drift.

0.80

Illustrative toy world: 90 seeded patients, the same two curves as Chapter 0, a little noise. With steering 0 each patient gets either treatment by a coin flip; with steering 1, mild patients almost always get treatment 1 and severe patients treatment 2. Errors are counted on 200 evenly spaced severities.

With a straight line and a smooth world, the method does well even under heavy steering. With the wiggly model, empty regions hurt. A nearest-neighbour model predicts the average outcome of the few most similar patients it has seen. If none are close, it quietly borrows from far away.

Route 2: causal methods

The second route asks a sharper question. For each patient, how much does treatment 2 change the outcome compared with treatment 1? That gap is the individual treatment effect, and an effect that differs between people is a heterogeneous one. Causal forests (Wager and Athey, 2018) grow many decision trees whose splits aim to separate people with different effects. The lecture also cites causal deep learning models, such as the generalisation bounds and algorithms of Shalit, Johansson and Sontag (2017) and the adapted networks of Shi, Blei and Veitch (2019). These give an effect estimate for each person. You then pick the treatment with the better effect.

Route 3: trees that optimise the rule directly

A policy is a rule from patient facts to a treatment. The third route learns the policy itself instead of first modelling outcomes. Optimal Policy Trees (Amram, Dunn and Zhuo) and Optimal Prescriptive Trees (Bertsimas, Dunn and Mundru) search for the flowchart of yes or no questions that gives the best average outcome. A flowchart is easy to read, which doctors like.

Route 4: the prescriptive neural network

The lecture’s own method is the fourth bullet, boxed on the slide. The next slide gives three reasons for it.

  1. It can use multimodal data. Notes, scans and signals all turn into vectors a network can read (Chapter 2).
  2. It has more modelling power. Trees learn curved functions, but the lecture says neural networks have empirically shown more.
  3. It scales to many treatments. A network adds one output per treatment. A tree search gets harder with every extra option.

The goal, in the slide’s words, is to use a neural network to minimise a differentiable loss function that represents the estimated average outcome after applying the treatment, similar to Optimal Policy Trees. “Differentiable” means we can compute a slope for every weight, so gradient descent can train it. Chapter 5 builds that loss from nothing.

Notice what changed between route 1 and route 4. Regress and compare asks “what will the outcome be?” and then compares. The PNN asks “which treatment should I pick?” and trains on that question directly. The outcomes it needs come from a separate step (Chapters 3 and 4).

What does “regress and compare” do for a new patient?

Chapter 2

From Messy Records to Numbers

Turn a table row, a radiology report and a scan into one list of numbers that a network can read

Open one patient’s file. It holds a row of numbers: age, blood pressure, a diabetes flag. It holds a paragraph a radiologist typed after an echocardiogram. It holds a CT scan, a grid of grey pixels. Three kinds of data, three shapes, one patient.

A neural network eats only a fixed-length list of numbers. So before any prescribing can happen, every part of the file must become part of that list. This chapter covers the first of the lecture’s four steps, and the overview slide that frames all four.

The four steps on one page

The sixth slide lays out the full recipe. We will follow it for the rest of the lesson, so here it is once, as a flow.

1. Embedding extraction
Every data source becomes numbers. Out: one vector x for each patient.
↓
2. Counterfactual estimation
Estimate the outcome under every treatment. Out: the rewards matrix, patients by treatments.
↓
3. PNN training
Train a feedforward network with a prescriptive objective. Out: probabilities over treatments.
↓
4. Mirrored OCT
Train an Optimal Classification Tree on the network’s prescriptions as the true labels. Out: a readable tree.

Steps 2 to 4 only ever see the vector from step 1. That is a useful design: add a new kind of data, and only step 1 changes.

Structured data: tidy the numbers

Structured data already sits in columns. The slide says to handle a table with appropriate processing, such as normalisation. Normalising means rescaling a column so that it has a mean of 0 and a spread of 1. The standard recipe is a z-score: subtract the column’s mean, then divide by its standard deviation (a measure of how far values typically sit from the mean).

Why bother? Age runs from 0 to 100. A yes or no flag runs from 0 to 1. Without rescaling, age would dominate the early arithmetic of the network simply because its numbers are bigger. Take three patients aged 50, 60 and 70. The mean is 60. The standard deviation is about 8.2. Their z-scores are −1.22, 0 and +1.22. Now age is on the same footing as everything else.

Unstructured data: borrow a trained encoder

Unstructured data has no columns: free text and images. The slide’s recipe has one line for each. For language, extract embeddings from a pretrained model such as BERT or Clinical Longformer. For images, do the same with a model such as DenseNet. (The slide lists a table inside the unstructured box too. A table inside it is treated as structured data, as above.)

An embedding is a list of numbers that stands for the meaning of a thing. Texts with similar meaning get similar lists. A pretrained model is one that was already trained, on a huge collection, for some other job. You run your data through it and keep the numbers from its last layer. You do not train it again. Its weights stay frozen.

Clinical Longformer is a language model trained on clinical notes and built to read long documents, which suits radiology reports. DenseNet is a convolutional image network (it slides small filters over pixels). Each turns one input into one fixed-length vector.

The sizes below are typical, and the slide does not state them: the base-size BERT family outputs 768 numbers, and DenseNet-121 outputs 1,024 numbers before its final classifier. Your own pipeline may differ. The principle does not.

Why freeze the encoders rather than train them? Our reasoning: the lecture’s datasets are small. The liver study has 722 patients and the TAVR study 2,127. That is too few to teach an image network what a CT scan looks like, but plenty to learn how to use a good description of one.

Join them into one vector

The final move is to concatenate: put the lists end to end. A patient with 8 table columns, a 768-number report embedding and a 1,024-number scan embedding becomes one vector of 8 + 768 + 1,024 = 1,800 numbers. The network then treats all 1,800 alike. Play with it.

Build the patient vector

Switch each source on or off and watch the vector grow. Drag the age to see its z-score. Blocks are drawn on a square-root scale so the 8 table numbers stay visible.

72

Illustrative sizes: 8 table columns, 768 numbers from a base-size language encoder and 1,024 from DenseNet-121. The age z-score uses an illustrative cohort mean of 65 and standard deviation of 10. A first layer of 64 hidden units is also illustrative.

Look at the weight count in the read-out. A first layer with 64 hidden units needs one weight per input per unit. With all three sources that is 1,800 × 64 = 115,200 weights before the first activation. Drop the scan and it falls to 49,664. More data means more to learn from, and more to fit.

One honest caution. Concatenation lets the network use all three sources, but it does not make it use them well. If scans carry the signal, the network must learn to look there. That is what the training step and the multimodal results (Chapter 8) show.

A team adds radiology reports to a prescriptive model. Which description of step 1 is correct?

Chapter 3

The Table With Missing Cells

See why every patient has outcomes we never observed, and how an estimated table lets us score any treatment rule

A hospital keeps a ledger. Each row is a patient. Each column is a treatment. In each cell goes the outcome that patient would have under that treatment, where a lower score is better. You expect a full grid. You find one filled cell per row.

Patient 1 received treatment 1 and scored 0.82. The other two cells in her row are empty. They stay empty forever, because she cannot go back and try the other drugs. That is the lecture’s eighth slide, drawn as a table with red question marks.

What a counterfactual is

A counterfactual is an outcome that did not happen: what the result for this patient would have been under a treatment she did not get. The word means “contrary to fact”. The slide defines counterfactuals as unknown outcomes for an observation given a theoretical treatment.

Count the loss. With Nt treatments, each row has one known cell and Nt − 1 unknown ones. With three treatments, two thirds of the table is missing. With ten, nine tenths. The bigger the menu, the emptier the table.

The lecture’s ledger has four rows, and the observed cells are these: patient 1 under treatment 1 gave 0.82; patient 2 under treatment 2 gave 0.36; patient n−1 under treatment 1 gave 0.38; patient n under treatment 3 gave 0.45. (The slide writes the four rows as i = 1, 2, n−1, n, with dots between them for the patients not shown.)

Why we want the full table anyway

A prescription rule is a function τ that takes a patient’s facts xi and returns a treatment τ(xi). To judge a rule, we ask: if we had followed it, what would the outcomes have been? For patients where the rule agrees with what the doctor did, we know the answer. For all others, we need the missing cells.

So the second step of the recipe is counterfactual estimation. The slide states it as: use observed data to infer the unobserved outcomes so that proposed prescription policies can be evaluated. Fill every empty cell with an estimate, and any rule can then be scored on the whole table.

The filled-in table, on slide 9, is the one we will use for the rest of the lesson.

PatientTreatment 1Treatment 2Treatment 3
i = 10.82 (seen)0.760.78
i = 20.450.36 (seen)0.40
i = n−10.38 (seen)0.390.38
i = n0.530.440.45 (seen)

On slide 10 this grid gets a name. It is the rewards matrix, written Γ (Greek capital gamma). Its element Γi,t is the estimated outcome of applying treatment t to patient i. The word “reward” is borrowed from reinforcement learning, where a lower-is-better outcome is just a negative reward. As a data structure, Γ is an array of shape (N, Nt): one row per patient, one column per treatment.

Notice what the estimates say. The lecture’s values for the seen cells equal what was observed. The other cells are guesses with a story behind them, such as: “patients like patient 1 who got treatment 2 scored 0.76”. How the guesses are made is the next chapter. First, feel what they are worth.

Fill the table, then pick

First view: only the cells we saw. Second: the estimator fills the rest. Third: the lowest cell in each row is the pick. Then raise the estimation error and see which picks flip.

0.000

Numbers are the lecture’s slide 9 table, with units unspecified (lower is better). The error knob is ours: each estimated cell gets a fixed nudge, up or down, of up to the size shown. Seen cells never change. A tie goes to the lower-numbered treatment.

Slide the error to 0.03. Row 1 has treatment 2 at 0.76 and treatment 3 at 0.78, only 0.02 apart. A nudge of 0.03 is bigger than that gap, so the pick flips to the worse drug. Rows 3 and 4 flip too, because their gaps are 0.01. Row 2 has a 0.04 gap and holds until the error passes 0.044. This is the failure mode of the whole method. The symptom is a rule that looks great on the estimated table and does badly on real patients. The measurement is how often a row’s pick flips when the estimates move by their typical error. The fix is better estimates (Chapter 4) and an honest test on held-out patients (Chapter 8).

A rewards matrix Γ has 2,000 patients and 4 treatments. How many of its cells hold an outcome that was actually observed?

Chapter 4

Filling the Table Fairly

Learn why doctors’ habits bias a naive estimate, and how a propensity score and a second model correct it

Dr. Kim has a habit. She gives the strong drug to her sickest patients and the mild drug to everyone else. A year later someone averages the results. The strong drug looks worse, because its patients were sicker to begin with. Nothing is wrong with the drug. The comparison is unfair.

That unfairness has a name. Treatment assignment bias is the pattern in which the kind of patient who gets a treatment differs from the kind who does not. The lecture flags it on slide 9, right beside the first way to fill the table.

The direct method

The direct method is the slide’s first option: one regression model for each treatment type. It is regress and compare from Chapter 1, now used for a different job. Instead of picking a winner, we use each model to fill a whole column of Γ. For patient i and treatment t, the cell is the model for t applied to xi.

The model learned from patients who got treatment t, so it is good where those patients live and shaky elsewhere. The slide marks that weakness as treatment assignment bias in brackets. The method gives answers that lean toward whoever the doctors happened to treat.

Doubly robust: add a second model and a correction

The slide’s second option is doubly robust estimation, in two parts.

  1. Estimate the propensity score. Train a classification model that predicts, from a patient’s facts, the probability that each treatment is assigned. That probability is the propensity score. It captures Dr. Kim’s habit as a number. A patient with a propensity of 0.9 for the strong drug was very likely to get it.
  2. Re-weight the direct estimates. Use the propensity score to re-weight the estimated outcomes from the direct method. The reason: a patient who got an unlikely treatment is rare evidence about that treatment, and should count for more.

The slide gives the two steps but not the formula. The standard form of the doubly robust estimate, from the causal inference literature, is the one below. Treat it as our fill-in for the slide’s words.

Γi,t
The doubly robust estimate of patient i’s outcome under treatment t. One cell of the rewards matrix.
μ̂t(xi)
The direct method’s guess: the regression model for treatment t, applied to patient i.
1{ti = t}
An indicator: 1 if patient i really received treatment t, and 0 otherwise. For cells we never saw, this is 0 and the correction vanishes.
yi − μ̂t(xi)
The residual: how far the real outcome sat from the model’s guess. It measures the model’s mistake on this patient.
êt(xi)
The propensity score: the estimated probability that patient i gets treatment t. Dividing by it boosts rare treatment choices.

Work one cell. Patient 5 got treatment 2 and scored 0.62. The model for treatment 2 had guessed 0.50. The propensity score for treatment 2 was 0.80. Then Γ5,2 = 0.50 + 1 × (0.62 − 0.50) / 0.80 = 0.50 + 0.15 = 0.65. The real outcome pulled the guess up by 0.15.

Now change one thing. Suppose the propensity had been 0.20, meaning the doctor almost never gave treatment 2 to patients like this. Then the pull is 0.12 / 0.20 = 0.60, and Γ5,2 = 1.10. A rare event moves the estimate a lot. That is the method working as intended, and also its danger: tiny propensities make wild estimates. Practitioners usually clip the score, for example to 0.05 or above, to keep one patient from swinging a result.

Why “doubly” robust

The estimate has two chances to be right. If the outcome model μ̂ is accurate, the residual is near zero and the answer is the model’s. If instead the propensity score is accurate, the correction exactly cancels the model’s bias. Only when both are badly wrong does it fail. That is a real guarantee from the literature, and the reason this step uses two models instead of one.

Test it. The device below asks a clean question: if every patient got treatment 2, what would the average outcome be? We know the true answer, because we built the toy world. Four estimators try to recover it from logged data in which doctors steered patients. Each one is shown averaged over 100 fresh samples of patients, so you see typical error and not luck.

Estimate the unseen average

The dashed line is the true average. Each bar is one estimator’s typical miss. Raise the steering and watch the naive average drift while the corrected ones hold. Then draw one fresh sample to see a single run.

0.80

Illustrative toy world with the curves of Chapter 0 and 300 patients per sample. The outcome model is a straight line fitted to treatment-2 patients. The propensity score is the true assignment chance, clipped at 0.05; a real pipeline would estimate it with a classifier. Naive means the plain average among treatment-2 patients. IPW means weighting those patients by 1 over the propensity.

At steering 1.0 the naive average misses by about 0.06 on a scale where the true value is 0.50. The weighted average alone (IPW) is noisy. The direct model is close. The doubly robust estimate is the closest and the steadiest, with a miss about 40% smaller than the direct model’s. Now the rewards matrix is fairer to the sick and the mild alike.

The slide ends this step by naming the output. Run the direct or doubly robust method for every patient and treatment, and you get Γ, the rewards matrix of Chapter 3. Every later step reads only that table.

In the doubly robust estimate, what does dividing the residual by the propensity score do?

Chapter 5

The Network and Its Loss

Build a classifier-shaped network whose training signal is the expected outcome, and see why a hard pick cannot learn

Picture a dial with three needles, one per treatment. For each patient, the network sets the needles. A tall needle means “I lean toward this drug”. The three heights always add up to 1, like slices of a pie. The doctor can read the tallest needle as the prescription.

The third step of the recipe trains that network. It has two parts: the shape of the network, and the thing it is trained to reduce. The second part is the clever one.

The shape: a classifier that has no labels

Slide 11 draws a plain feedforward network: numbers flow one way, from input to output, with no loops. It has three layers of arithmetic. Each layer takes a weighted sum of its inputs plus a bias (a constant nudge). The first two layers then pass the result through ReLU, which keeps positive numbers and turns negatives into zero. The last layer ends with softmax.

Here is the data flow, with shapes. Let d be the length of the input vector (1,800 in Chapter 2) and m the width the engineer chooses for the hidden layers.

  1. Input x, shape (d). Weighted sum, then ReLU. Out: z(1), shape (m).
  2. Hidden layer. Weighted sum, then ReLU. Out: z(2), shape (m).
  3. Output layer. Weighted sum of z(2) gives one raw score for each treatment, shape (Nt). Softmax turns them into probabilities, z(3).

The slide’s indices are loose. The shapes above are what matter. The network is built like a classifier: Nt outputs that sum to 1. A normal classifier trains against a correct label. Here no correct label exists, because nobody knows the best treatment for any patient. The loss must come from somewhere else.

Softmax: raw scores to a pie

The slide gives the softmax formula for the network’s output. The chance that the network assigns treatment t to patient i is

ℙ[τ(xi) = t]
The probability that the network assigns treatment t to patient i. The slide calls it the PNN’s softmax output.
exp(zt)
e raised to the raw score for treatment t. It turns any number, negative or positive, into a positive one. A bigger score gives a much bigger result.
∑ exp(zs)
The same quantity for all Nt treatments, added up. Dividing by it makes the pie slices sum to 1.

Work one. Raw scores z = (0.2, 1.0, 0.7). Then exp gives (1.22, 2.72, 2.01), which add up to 5.95. Divide each: (0.205, 0.457, 0.338). Treatment 2 has the biggest slice. Every slice stays above zero, so no treatment is ever ruled out completely.

The loss that cannot learn, and the one that can

Now the key question: what should the network be trained to reduce? Slide 12 states the target as a goal. Let Γi,t be the estimated outcome of patient i under treatment t (Chapter 3), and let τ(xi) be the treatment the rule assigns. Then the average outcome under the rule is

minτ (1/N)
Search for the rule τ that makes the average smallest. Lower outcome is better.
∑∑
Add up over every patient i and every treatment t.
1{τ(xi) = t}
The indicator: 1 if the rule gives patient i treatment t, otherwise 0. Only one treatment per patient survives.
Γi,t
The rewards matrix cell for that patient and treatment.

This is the loss Optimal Policy Trees use, and the slide cites them. A tree can search over rules directly. A neural network cannot, because the indicator is a step. Nudge a weight a tiny amount and the assigned treatment either stays the same, so the loss does not move, or jumps, so the loss jumps. Gradient descent needs a smooth slope. The indicator gives zero slope nearly everywhere.

Slide 13 makes one swap. Replace the indicator with the softmax probability. The loss becomes the expected outcome: for each patient, add up each treatment’s estimated outcome weighted by the chance the network picks it.

Li = ∑t pt Γi,t, and the training loss is the mean of Li over patients. It is smooth, so every weight gets a slope. The slope for a raw score has a clean form: ∂Li/∂zt = pt (Γi,t − Li). Read it as a rule. If treatment t is better than the patient’s current expected outcome (Γ below L), the slope is negative and descent raises zt. If it is worse, descent lowers zt. The size of the push scales with pt, so likely choices get adjusted most.

Take patient 1, with Γ = (0.82, 0.76, 0.78) and the pie from above, (0.205, 0.457, 0.338). Then L = 0.779. The slopes are +0.0084, −0.0087 and +0.0003. Descent lowers z1, raises z2, and barely touches z3. Try it.

Turn scores into an expected outcome

Pick a patient. Drag the three raw scores and watch the pie of probabilities and the expected outcome. Arrows show which way a gradient step moves each score. Press Take a step a few times.

0.20
1.00
0.70

Outcomes are the four patients of the lecture’s slide 14 table (patient 3 row 0.38, 0.39, 0.30). The step uses learning rate 3 on the slope pt(Γt − L), so the motion is visible. A real network moves weights, and these scores come from them.

The code for the whole loss is one line. With probs of shape (N, Nt) from the network and gamma of the same shape from Chapter 4:

python
probs = torch.softmax(net(x), dim=1)        # (N, Nt), each row sums to 1
loss  = (probs * gamma).sum(dim=1).mean()   # expected outcome, averaged over patients
loss.backward()                             # slope p_t * (gamma_t - L) reaches every weight
Why does the PNN loss use the softmax probability where the Optimal Policy Tree loss uses the indicator?

Chapter 6

Train It Yourself

Score a hard rule and a soft rule on the same four patients, then train a small network and watch its pie sharpen

You now hold every part. A rewards matrix says how good each choice would be. A network turns a patient into a pie of probabilities. A loss says how good the pie is. Slide 14 puts all three on one page with four patients, and the arithmetic is worth doing by hand once.

The slide-14 example, step by step

The left table is the rewards matrix for four patients. The right table shows what two methods prescribe for them. The Optimal Policy Tree gives a hard answer, a one-hot row such as [0, 1, 0], which means “treatment 2, nothing else”. The PNN gives a soft answer, a pie such as [0.2, 0.45, 0.35].

PatientOutcomes (t1, t2, t3)Tree prescriptionPNN prescription
i = 10.82, 0.76, 0.78[0, 1, 0][0.2, 0.45, 0.35]
i = 20.45, 0.36, 0.40[0, 1, 0][0.1, 0.6, 0.3]
i = 30.38, 0.39, 0.30[0, 0, 1][0.45, 0.4, 0.15]
i = 40.53, 0.44, 0.45[0, 1, 0][0.1, 0.5, 0.4]

The slide prints patient 4’s last probability with a stray full stop; we read it as [0.1, 0.5, 0.4], which matches the objective line below it. Each objective adds up one number per patient: the prescription row times the outcome row. For the tree, the one-hot row just picks a cell.

Tree: 0.76 + 0.36 + 0.30 + 0.44 = 1.86 (mean 0.465)

For the PNN, each patient gets a weighted sum over all three cells:

Patient 1: 0.2 × 0.82 + 0.45 × 0.76 + 0.35 × 0.78 = 0.164 + 0.342 + 0.273 = 0.779

Patient 2: 0.1 × 0.45 + 0.6 × 0.36 + 0.3 × 0.40 = 0.045 + 0.216 + 0.120 = 0.381

Patient 3: 0.45 × 0.38 + 0.4 × 0.39 + 0.15 × 0.30 = 0.171 + 0.156 + 0.045 = 0.372

Patient 4: 0.1 × 0.53 + 0.5 × 0.44 + 0.4 × 0.45 = 0.053 + 0.220 + 0.180 = 0.453

PNN: 0.779 + 0.381 + 0.372 + 0.453 = 1.985 (mean 0.496)

The PNN scores 1.985 against the tree’s 1.86. Lower is better, so the tree wins here. Do not conclude that trees are better. Look at why. The tree picked the lowest cell in every row, so 1.86 is the best any rule can do on these four rows. The PNN is still hedging: it puts 0.2 on treatment 1 for patient 1, even though treatment 1 is the worst cell. Training exists to close that gap. Each step shifts probability toward lower cells until the pie sharpens.

Two more points from the arithmetic. First, the soft loss is a straight weighted average, so its best answer is always the hard one: put all the weight on the lowest cell. Softmax does not force hedging. It just lets the network get there smoothly. Second, for patient 3 the PNN puts 0.45 on treatment 1 and only 0.15 on the best treatment, treatment 3. That patient has the biggest room to improve. The slope pt(Γt − L) from Chapter 5 will push hardest on exactly this row.

Training on many patients

Real training does the same sum for every patient at once, in batches. Here is the loop, with shapes in the comments.

python
net = nn.Sequential(nn.Linear(d, m), nn.ReLU(), nn.Linear(m, m), nn.ReLU(), nn.Linear(m, Nt))
opt = torch.optim.Adam(net.parameters(), lr=1e-3)

for epoch in range(100):
    for xb, gb in loader:                    # xb: (B, d) patient vectors, gb: (B, Nt) rewards rows
        probs = torch.softmax(net(xb), dim=1)    # (B, Nt)
        loss  = (probs * gb).sum(dim=1).mean()   # expected outcome
        opt.zero_grad(); loss.backward(); opt.step()

prescription = net(x_new).argmax(dim=1)      # at deployment, take the tallest needle

At deployment you take the tallest needle. In the lecture’s framing the soft pie is a training device, and the prescription is the pick.

Now watch the pie sharpen. Below, 80 toy patients have one feature each (how ill they are) and three treatments whose outcomes cross. A small network, one hidden layer of 8 ReLU units, learns to choose with nothing but the loss from Chapter 5.

Train a tiny PNN

Top: each treatment’s true outcome curve, with the network’s expected outcome as a teal dashed line. Bottom bar: the network’s pie at each severity. Press Train 10 steps and compare learning rates.

Illustrative toy data, not patients: 80 evenly spaced severities, three outcome curves with a little fixed noise, and full-batch gradient descent on the expected-outcome loss. “Oracle” is the average of the lowest noisy cell per patient; it needs hindsight, so no rule that sees only severity can reach it.

Run it at learning rate 3. After 10 steps the average expected outcome drops from about 0.48 to about 0.38, and after 100 steps the bar at the bottom splits into three clean regions at about 0.36. The hard pick then scores about 0.36, against the 0.32 oracle, and the gap that remains is noise no rule could see. At learning rate 1 the loss needs about 100 steps to reach 0.37. At learning rate 10 it gets there in 10, but on harder data a big step can overshoot, which shows up as a loss that rises instead of falls.

One failure to watch in real use. The network trains on the estimated table, so it can learn the table’s mistakes. The symptom is a loss that keeps falling on training patients while real outcomes do not improve. The measurement is the score on patients held out from training. The fixes are the usual ones: weight decay, early stopping, and the held-out test that Chapter 8 describes.

On slide 14 the tree scores 1.86 and the PNN scores 1.985, where lower is better. What is the best reading?

Chapter 7

The Tree That Mirrors the Network

Copy a black-box network into a readable tree, and measure what the copy keeps

A surgeon looks at the network’s advice: valve B for this patient. She asks one question. “Why?” The network can only answer with numbers, thousands of them, none with a name. It cannot say “because the aortic valve area is small”. She will not stake a patient on that.

Slide 15 draws the problem as a sample going into a black box and a prescription coming out. A black-box model is one whose inner working we cannot read, even though we can see its inputs and outputs. The lecture’s fourth step exists to open the box.

A tree is a list of questions

A decision tree classifies a patient by asking a chain of yes or no questions about the features. Is the aortic valve area below 1.0? If yes, go left. Is the patient older than 78? And so on, until a leaf names a treatment. Each question is a split: a feature and a split value. Slide 24 shows a mirrored tree with those two labelled on its drawing, features on the nodes and split values on the branches, and leaves coloured by the treatment they predict.

Anyone can follow it with a finger, from the root to a leaf. That is what “extremely interpretable” means on slide 16. You can read exactly why this patient received this treatment, and you can check each question against medical sense.

Mirroring

The slide’s approach is to train an Optimal Classification Tree (OCT), from Bertsimas and Dunn (2017), with a twist. The usual job of a classification tree is to predict a known label. Here the labels are not real. They are the network’s prescriptions. The tree is trained on the original data’s features, with the PNN’s pick for each patient as its target class. The slide calls this mirroring, and the result is a Mirrored OCT.

A fair picture: the network is a teacher and the tree is a student who copies the teacher’s answers while writing down a reason for each. (The comparison is ours; a student trained on a teacher’s outputs is often called distillation elsewhere in machine learning.)

Two details are worth stating. First, an optimal tree is found by solving for the whole tree at once, with optimisation, which is different from the quick greedy method most libraries use, where each split is chosen alone. The lecture cites the optimal version. Second, the slide says the tree uses the original features. It does not say how image or report embeddings enter the tree, so we do not claim that.

What the copy keeps

A tree with one split cannot copy a network that thinks in curves. A deeper tree copies more, but is harder to read. That tension is the whole chapter, and it is easy to feel. Below, a stand-in teacher policy decides among three treatments from two features. A tree of chosen depth tries to mirror it.

Mirror the teacher

Dots are patients, coloured by the treatment the teacher network prescribes. Shaded regions are what the tree prescribes. Red rings mark patients where the tree disagrees with the teacher. Change the depth.

Illustrative: 160 seeded toy patients and an invented teacher rule with a slanted boundary. The tree is a greedy Gini tree, a simple stand-in; the lecture uses Optimal Classification Trees, which optimise the whole tree at once. Agreement is measured on the same patients the tree was fitted to.

At depth 0 the tree has a single leaf and predicts the most common treatment for everyone: 66 of 160 patients, which is 41%. At depth 1, one question splits the plane and agreement jumps to 71%. At depth 2 the tree asks just two questions, a flowchart a person can read aloud, and agrees for 94%. At depth 4 agreement reaches 99%, but the tree now asks six questions, and the extra ones carve out small groups of patients.

Here is how to read the trade. Agreement with the teacher is a measure of fidelity. It says nothing about whether the teacher was right. A faithful copy of a poor teacher is still poor. So the chapter’s failure mode has three steps. The symptom: a tree that looks sensible but prescribes worse than the network. The measurement: improvement on held-out patients, for the tree and the network side by side. The fix: a deeper tree, or a better teacher. The lecture does exactly this measurement, and Chapter 8 shows how close the copy comes.

For realisation, a quick stand-in for the mirroring step uses a standard library, which returns a greedy tree:

python
from sklearn.tree import DecisionTreeClassifier, export_text

pnn_pick = net(x).argmax(dim=1).numpy()          # (N,) the teacher's prescriptions
tree = DecisionTreeClassifier(max_depth=3).fit(features, pnn_pick)   # features: (N, d_table)
fidelity = (tree.predict(features) == pnn_pick).mean()
print(export_text(tree, feature_names=names))    # the rules a doctor can read
What is the training target for a Mirrored OCT?

Chapter 8

Six Experiments, and How to Score a Prescription

Learn the lecture’s scoring rule, then read its six results, including the ones where methods fail

A coach wants to know whether a new playbook beats the old one. She cannot replay last season with the new plays, because history happened only once. This is the prescriptive problem again, and it makes testing awkward. How do you score a treatment rule when each patient only ever received one treatment?

The scoring rule

Slide 17 sets the procedure. Split the patients at random into a 50% training set and a 50% test set. Train each kind of model on the training half. Score it on the test half. Repeat for many random splits, with fresh models each time, and report the average with its spread. The spread matters: a method that wins on one split and loses on the next has not won.

The slide lists five model classes. Two are the lecture’s own: the PNN and the Mirrored OCT. Three are baselines, run on structured data only: Regress & Compare, Causal Forests and Optimal Policy Trees (Chapter 1). They cannot read scans or reports, which is why they cannot appear in every column.

The metric is the average relative improvement of the outcome on the test set. As we read the slide’s formula, it compares, for each test patient, the outcome under the treatment actually given with the outcome under the treatment the model recommends. It sums both over patients, then divides the total drop by the total under the given treatments. Take three patients. Under what they received, the outcomes sum to 0.6 + 0.5 + 0.4 = 1.5. Under the model’s picks they sum to 0.5 + 0.4 + 0.35 = 1.25. The improvement is (1.5 − 1.25) / 1.5 = 16.7%. A positive number means the model’s rule would have done better than the doctors did. A negative one means worse.

One caution lives in the scoring itself. The outcomes under the recommended treatment are, for most patients, estimates from the rewards matrix (Chapters 3 and 4). The score is therefore only as honest as that table. That is why the TAVR and liver slides list the counterfactual estimator as a row: tabular or multimodal.

For the groceries study the goal is revenue, so higher is better, and the slide reports improvement with respect to revenue, which the slide builds from the price and the estimated outcome. That is why a number can exceed 100%.

The six datasets

StudyDataTreatmentGoal
TAVR valve2,127 patients with tables and echocardiogram and CT reportsBinary: EVOLUT PRO or SAPIEN 3 valveMinimise permanent pacemaker implantation
Liver injury722 patients with records and liver CT reportsBinary: surgery or no surgeryMinimise mortality
Diabetes58,200 type 2 patients, Boston Medical Center, 1999 to 2014Several continuous: doses of metformin, insulin, oral agentsMinimise HbA1c
Groceries97,295 rows of transaction, product and household dataOne continuous: price of strawberriesMaximise revenue
Spleen injury35,954 rows of patient dataThree discrete: splenectomy, angioembolization, observationMinimise mortality
REBOA9,998 patients with noncompressible torso hemorrhageBinary: REBOA or notMinimise mortality

Notice the range of treatment types. This is what the first slides promised: yes or no, several discrete options, one continuous knob, several continuous knobs. A single network, with one output per option, covers all of them.

Read the results

Choose a study. Each bar is the average relative improvement of one method, with its spread as a whisker. Red bars are methods that did worse than what doctors did.

Every number is from the lecture’s slides 18 to 23: mean improvement (%) with the spread in brackets that the slides print. For TAVR and liver we show the rows that use the multimodal counterfactual estimator, split by whether the model saw the table only or table plus reports and scans; Regress & Compare, Causal Forests and Optimal Policy Trees use structured data only, so they appear in the other four studies.

What the numbers say

On the three studies with a clear field (diabetes, groceries, spleen), the PNN is the top bar, and the Mirrored OCT usually follows within a spread or so. On diabetes the margin is small: 3.15 against 3.06 for the tree, 2.90 for regress and compare and 1.60 for causal forests. On groceries both reach about 110%, ahead of the Optimal Policy Tree at 106.58%. On the spleen study the PNN gets 13.52% against 12.98% for the policy tree, a gap well inside the spreads.

Two studies tell a more mixed story. On liver injury the Mirrored OCT beats the PNN: 29.15% against 25.25% with multimodal data, and a larger edge with tables only. On REBOA the three tree and network methods are close, 17.17% to 18.09%, but regress and compare and causal forests score −19.69% and −19.31%. Their rules would have done worse than the doctors. This is the failure Chapter 1 predicted: when the outcome models are wrong in the regions where the rule is decided, a method that trusts them pays for it.

The multimodal gain is the headline on TAVR. With the multimodal estimator, the PNN moves from 21.09% to 42.89% when it sees reports and scans as well as the table. The gain on the liver study is smaller (23.14% to 25.25%, with a spread near 3). Extra data can help a great deal, a little, or not at all, and the tree on liver data shows no gain (29.14% to 29.15%).

On the REBOA study, regress and compare scored −19.69%. What does a negative improvement mean?

Chapter 9

Field Guide: The Whole Lecture on One Page

Keep the four steps, the key numbers, a checklist and the core code, and find where to go next

The lecture ends with one slide that says what we learned. The prescriptive neural network framework extends Optimal Policy Trees to multimodal data, in four steps: compute embeddings, estimate counterfactuals, train the PNN, train the Mirrored OCT. Its classification-style feedforward network takes in several data sources with ease. PNNs and Mirrored OCTs perform better than, or about the same as, existing prescriptive methods. Mirrored OCTs recover interpretability without giving up much performance.

Our one-sentence version: estimate every cell of the outcome table fairly, train a network to minimise the expected outcome under its own choice probabilities, then copy its choices into a tree so people can read the reasons.

The numbers and terms

Term or numberWhat it meansWhere
Optimal prescription problemFor patient facts x, pick treatment t that minimises the outcome yChapter 0
CounterfactualThe outcome under a treatment the patient did not getChapter 3
Rewards matrix ΓArray of shape (N, Nt) of estimated outcomes, one cell per patient and treatmentChapters 3 and 4
Propensity scoreEstimated probability that a patient receives a given treatmentChapter 4
Doubly robust estimateDirect model guess plus a propensity-weighted residual; right if either model is rightChapter 4
PNN lossMean over patients of the sum over treatments of probability times estimated outcomeChapter 5
Slope of that losspt (Γt − L) for each raw scoreChapter 5
Slide-14 objectivesTree 1.86, PNN 1.985 on four patients (lower is better)Chapter 6
Mirrored OCTOptimal Classification Tree trained on the PNN’s prescriptionsChapter 7
EvaluationMany random 50/50 splits; average relative improvement on the test halfChapter 8
TAVR, multimodalPNN 42.89% (spread 5.64), Mirrored OCT 41.66% (7.00); tabular 21.09% and 22.58%Chapter 8
GroceriesPNN 110.88% against 94.17% for regress and compareChapter 8
REBOARegress and compare −19.69%, causal forest −19.31%, PNN 17.87%, Mirrored OCT 18.09%Chapter 8

A checklist before you trust a prescriptive model

  1. Is the treatment you are choosing really a choice? If the data came from doctors’ habits, name the habit and check the records hold what the doctors used (Chapter 4).
  2. Do the treatments overlap? Every kind of patient should have received more than one option. Where one option is never seen, its estimate is a guess.
  3. How big is the smallest gap? If rows differ by less than the estimate’s error, the pick is noise (Chapter 3).
  4. Is the score on held-out patients? Many random splits, with the spread (Chapter 8).
  5. Did a simple baseline lose, or go negative? A negative bar means the method’s own models are wrong where it matters.
  6. Can a person read the rule? Mirror it, and report both fidelity and held-out improvement (Chapter 7).

The core as code

python
# Step 1: embeddings (frozen encoders), then join
x = torch.cat([zscore(table), text_encoder(report), image_encoder(scan)], dim=1)   # (N, d)

# Step 2: rewards matrix by the doubly robust estimate
gamma = np.zeros((N, Nt))
for t in range(Nt):
    mu_t = fit_outcome_model(x[T == t], y[T == t])             # direct method, one model per treatment
    e_t  = np.clip(propensity.predict_proba(x)[:, t], 0.05, 1)   # classifier, clipped
    gamma[:, t] = mu_t(x) + (T == t) * (y - mu_t(x)) / e_t

# Step 3: train the network on the expected outcome
net = nn.Sequential(nn.Linear(d, m), nn.ReLU(), nn.Linear(m, m), nn.ReLU(), nn.Linear(m, Nt))
for xb, gb in loader:
    loss = (torch.softmax(net(xb), 1) * gb).sum(1).mean()
    opt.zero_grad(); loss.backward(); opt.step()

# Step 4: mirror it in a tree
pick = net(x).argmax(1).numpy()
tree = DecisionTreeClassifier(max_depth=3).fit(table_features, pick)   # stand-in for an OCT

Where this sits in the field

Prescriptive modelling sits where prediction meets decision. Choosing an action to improve a reward is the core of reinforcement learning, and learning it from logged data is called offline learning; our Offline RL and Off-Policy Actor-Critic lessons teach the sequential version. Bandits and preference learning covers the one-step case where you can try options. Our MDP lesson gives the language of rewards and policies. Chapter 2’s encoders are explained in Vector Embeddings, and the idea of copying a model into a smaller one is the subject of Knowledge Distillation.

The takeaway. A treatment rule can only be as good as the table of outcomes behind it. Fill that table fairly, train on the expected outcome so the loss is smooth, and mirror the network into a tree so that a person can check the reasons.

The lecture sits in the MIT course MMAI: Multimodal AI (Spring 2026), taught by Paul Liang of the MIT Multisensory Intelligence group; this session’s deck is by Dimitris Bertsimas, Lisa Everest and Vasiliki Stoumpou. See the lecture slides (PDF) and the course schedule. Everything above is our own re-teaching; the course owns the slides and the results.

Now press Present or Teach and explain, from memory, how a prescriptive neural network is built: how the missing outcomes are filled, why the loss uses probabilities, and what the mirrored tree is for. Then go back to the valve instrument at the top and say why reports and scans doubled the improvement.

MMAI L15: Prescriptive Modeling
MIT MMAI course site · Back to Gleams