Skip to main content
AI Foundations

⏱ About 20 min20 XP

Framing the Problem

The most expensive mistake in machine learning is building the wrong thing perfectly. A beautifully trained model that answers the wrong question is worse than useless — it creates false confidence while failing to solve the actual problem. Problem framing is the discipline of translating a vague real-world goal into a precise, measurable ML task before a single line of code is written. It sounds like a preliminary formality; in practice it is the stage where the most valuable thinking happens.

From Goal to Task

Real goals arrive in natural language: 'we want to reduce customer churn,' 'we need to speed up document review,' 'we want to catch fraud earlier.' These are goals, not ML tasks. Turning a goal into a task requires answering four questions with precision. First: what is the input? What data will the model receive at prediction time? For a churn predictor, inputs might be a customer's subscription length, recent login frequency, and support ticket history. Second: what is the output? What should the model produce? A single category? A probability? A continuous number? For churn, you might want a probability that the customer cancels within 30 days — not just a yes/no label, because you need to rank customers by risk. Third: what task type is this? Classification, regression, or clustering? A probability of churn is the output of a classification model (it predicts a class and also reports its confidence), not a regression model, because the underlying target is a binary outcome: churned or not. Fourth: what does success mean, and how will you measure it? Defining success upfront — before you have seen any model results — is essential. Otherwise you will unconsciously choose the metric that makes your model look best, rather than the one that answers the business question.

Defining Success Precisely

A success metric must be (1) measurable from data, (2) directly tied to the real-world goal, and (3) chosen before model development begins. 'High accuracy' is not a success metric. 'Precision of at least 90% on fraudulent transactions, with recall above 80%' is a success metric.

Consider a concrete example. A university wants to identify first-year students who are at risk of dropping out so that advisors can intervene early. The goal is clear: reduce dropout rates. But the ML task could be framed several ways. Option A: Classify each student as 'at risk' or 'not at risk' at the end of their first semester. Option B: Predict, as a continuous probability, the likelihood each student drops out before graduation. Option C: Cluster students into groups and investigate which groups have historically high dropout rates. Option A is the simplest and most actionable: advisors get a list. But a binary label discards information — a student at 51% risk and one at 99% risk both appear in the same list, yet one clearly needs more urgent attention. Option B preserves that information and lets advisors prioritize. Option C is exploratory and does not directly answer the actionable question. Option B is likely the right frame — but only after this analysis is done explicitly, not accidentally.

The Proxy Problem

Even a well-framed task is only a proxy for the underlying goal. The model predicts something measurable; the goal is something real. The gap between them is always worth scrutinizing. YouTube's recommendation system was, for years, framed around maximizing watch time — a measurable proxy for user satisfaction. Watch time is easy to measure; satisfaction is not. The problem: sensational and outrage-inducing videos drove high watch time but low satisfaction and real-world harm. The proxy was imperfect, and optimizing it hard produced outcomes nobody wanted. A well-framed ML problem explicitly names the proxy and examines where it might diverge from the true goal. If the proxy is far from perfect, the entire framing should be reconsidered before training a single model.

Goodhart's Law

'When a measure becomes a target, it ceases to be a good measure.' — Charles Goodhart. In ML: optimizing a proxy metric hard often degrades the underlying goal it was meant to capture. Name your proxy explicitly and monitor the gap between the proxy and the real-world outcome.

Flashcards — click each card to reveal the answer

A team wants to predict whether a loan applicant will default within one year. They decide to predict the exact number of days until default. What is wrong with this framing?

Why should you define your success metric before training any model?

Frame a Real Problem

  1. Pick one of the following real scenarios (or choose your own with instructor approval):
  2. - A public library wants to recommend books to patrons.
  3. - A city traffic department wants to reduce intersection accidents.
  4. - A streaming service wants to keep subscribers from canceling.
  5. For your chosen scenario, write a structured one-page problem frame that answers all four questions:
  6. 1. What is the input? List specific data fields.
  7. 2. What is the output? Be precise about format.
  8. 3. What ML task type is this? Justify your choice.
  9. 4. What is your success metric? Write it as a quantitative statement.
  10. Then write one paragraph identifying the proxy gap: where might your measurable metric diverge from the true underlying goal?