Skip to main content

From Prediction to Decision

A prediction describes an uncertain quantity; a decision chooses an action. Prediction is not a decision: even an accurate estimate does not specify whose outcomes matter, which resources are scarce, or which actions are allowed. Optimization makes those choices explicit enough to inspect.

Prerequisites​

Complete Introduction to Linear Programming. This path links that mathematical introduction instead of repeating its simplex derivation. You should also be comfortable reading vectors and inequalities.

Learning goals​

  • Separate estimated coefficients, a chosen objective, and a feasible action.
  • State decision units and resource units before calling a solver.
  • Read a solver status before using its candidate solution.
  • Explain why an optimal model result does not establish real-world validity.

One allocation question​

A community learning hub plans one week. Let xWx_W and xCx_C be continuous workshop and clinic batches per week. A batch is a divisible planning unit here; if only whole batches can be scheduled, that is the discrete model introduced in Ticket 59.

Planning estimates assign 8 benefit points to a workshop batch and 6 to a clinic batch. The chosen objective is predicted benefit points per week, not money, welfare, or a causal effect. Each workshop batch uses 2 staff-hours and 1 room-hour; each clinic batch uses 1 staff-hour and 2 room-hours. The hard capacities are 40 staff-hours per week and 50 room-hours per week.

max⁡xW,xC8xW+6xCsubject to2xW+xC≤40,xW+2xC≤50,xW,xC≥0.\begin{aligned} \max_{x_W,x_C}\quad &8x_W+6x_C\\ \text{subject to}\quad &2x_W+x_C\le40,\\ &x_W+2x_C\le50,\\ &x_W,x_C\ge0. \end{aligned}

The coefficients may come from historical measurement or a predictive model, but putting them in an objective is a governance choice. Capacity data, eligibility, omitted harms, uncertainty, and implementation still need validation.

Worked example​

SciPy's linprog minimizes, so maximizing benefit requires negating the objective. Bounds are supplied explicitly even though SciPy's default is nonnegative.

import numpy as np
from scipy.optimize import linprog

benefit = np.array([8.0, 6.0]) # benefit points per batch
resource_use = np.array([[2.0, 1.0], [1.0, 2.0]])
capacity = np.array([40.0, 50.0]) # staff-hours, room-hours per week
result = linprog(-benefit, A_ub=resource_use, b_ub=capacity,
bounds=[(0.0, None), (0.0, None)], method="highs")
if result.status != 0:
raise RuntimeError(result.message)

print(f"solver=HiGHS status={result.status} success={result.success}")
print(f"workshop_batches={result.x[0]:.1f} clinic_batches={result.x[1]:.1f}")
print(f"predicted_benefit_points={-result.fun:.1f} real_world_validity=not_established")

Expected output:

solver=HiGHS status=0 success=True
workshop_batches=10.0 clinic_batches=20.0
predicted_benefit_points=200.0 real_world_validity=not_established

The result is optimal for the encoded continuous LP within numerical tolerances. It is not evidence that 200 benefits will occur, that the score is causally affected by service, or that the allocation is equitable.

Limitations and common mistakes​

  • Optimizing a predictive score can amplify selection bias or proxy discrimination in that score.
  • A point estimate hides uncertainty; later lessons use scenarios, and ticket 60 addresses uncertainty explicitly.
  • An omitted constraint cannot be respected by the solver.
  • Fractional batches are meaningful only if the planning unit is actually divisible.
  • Solver success establishes model-level evidence, not operational feasibility or real-world validity.

Practice​

Write down one decision that could use a demand forecast. Name the action, its unit, one hard constraint, the outcome estimate, the stakeholder who chose the objective, and one fact the solver result could not validate.

Next steps​

Make every symbol and unit auditable in decision variables, objectives, and constraints.

Primary sources​

Checked 2026-10-18: SciPy 1.18.1, linprog and the optimization tutorial; Stanford EE364A, Linear Programming; Boyd and Vandenberghe, Convex Optimization.