Skip to main content
Machine Learning & Deep Learning

⏱ About 15 min15 XP

Making a Prediction

Every time you open a streaming app and it recommends a show, a model just made a prediction about you. It looked at your history, processed it through thousands of learned rules, and output a guess: you will probably like this. That guess is a prediction — and learning how models make them is the first step to understanding machine learning from the inside.

From Input to Output

A machine learning model is, at its core, a mathematical function. You hand it an input — a set of numbers representing features of something — and it hands back an output number (or a category). Example: imagine a model that predicts whether an email is spam. Its input might be features like: number of exclamation marks, whether the word 'FREE' appears, how many links it contains. The model combines those features using weights — numbers it learned during training — and produces an output. If that output crosses a threshold, it predicts 'spam.' If not, it predicts 'not spam.' The key insight: the model does not look at the email the way you do. It sees only numbers, runs a calculation, and returns a number. Everything else — words, images, sound — must first be converted to numbers before a model can touch it.

What a Prediction Is

A prediction is the model's output for a given input. It is always a number (or derived from one). The model does not 'think' — it calculates. The quality of that calculation depends entirely on what the model learned during training.

Consider a concrete worked example. A model predicts tomorrow's high temperature. Its features are: today's temperature, humidity, wind speed, and month of year. It multiplies each feature by a learned weight and adds the results together (this is called a linear model). If today is 72°F with moderate humidity and low wind in July, the model might output 78°F as tomorrow's prediction. A human meteorologist uses vastly more information, but the principle — combine inputs, produce output — is the same.

Classification vs. Regression

Predictions come in two major flavors, and knowing the difference matters for every lesson in this module. Classification: the model predicts a category. Is this email spam or not spam? Is this photo a cat, dog, or bird? Will this student pass or fail? The output is a class label. Regression: the model predicts a number on a continuous scale. What will tomorrow's temperature be? How much will this house sell for? How many minutes until a bus arrives? The output is a quantity. Same idea — input features, learned weights, output — but the end result is shaped differently. Many lessons ahead will use both types, so keep them straight.

Quick Test

Ask yourself: is the answer a category (yes/no, A/B/C) or a quantity (a number on a scale)? Category = classification. Number on a scale = regression.

Match each term to its definition.

Terms

Feature
Weight
Classification
Regression
Prediction

Definitions

A prediction that outputs a number on a continuous scale
A prediction that outputs a category label
The model's computed output for a given input
A learned number the model multiplies a feature by
A measurable property of the input, expressed as a number

Drag terms onto their definitions, or click a term then click a definition to match.

A model looks at a patient's age, blood pressure, and cholesterol level, then outputs 'high risk' or 'low risk' for heart disease. What type of problem is this?

What does a model's weight represent?

Spot the Prediction Type

  1. Step 1: List three apps or services you use regularly (social media, maps, music, games, etc.).
  2. Step 2: For each one, identify one prediction the app makes about you or your data.
  3. Step 3: Label each prediction as classification or regression and explain your reasoning in one sentence.
  4. Step 4: Share your list with a classmate and discuss any disagreements — some predictions are surprisingly tricky to categorize.