Making a Prediction
A trained model is not just a pile of learned parameters sitting idle. Its whole purpose is to be used: give it new inputs it has never seen before, and it produces an output. That output is a prediction — the model's best guess about whatever question it was trained to answer. Understanding what kinds of predictions models make, and how they make them, is the next step to seeing machine learning clearly.
Input Goes In, Output Comes Out
When you use a trained model, the process looks simple from the outside. You provide feature values — the inputs — and the model produces an output. Under the hood, the input values flow through the model's learned parameters (essentially a chain of mathematical operations) and emerge as a prediction. The key property: the same input always produces the same output. A trained model is deterministic — no randomness, no guessing in the ordinary sense. If you feed the model a photo of a dog today and the same photo next Tuesday, you get the same prediction both times. The randomness only happens during training; once training is complete, the model's behavior is fixed. This is worth pausing on. The model does not 'think about' the input the way a human would. It is performing a fixed mathematical transformation on numbers. The intelligence — if we want to use that word loosely — comes from how well those parameters were tuned during training.
Using a trained model to make predictions on new data is called inference (or sometimes prediction or deployment). It is separate from training — training is when the model learns; inference is when it applies what it learned.
There are two broad categories of prediction, and knowing which one a model is doing tells you a lot about how to use it and evaluate it. Classification: the model predicts which category an input belongs to. The output is a label chosen from a fixed set. Is this email spam or not spam? Is this photo a cat, a dog, or neither? Will this customer churn in the next month — yes or no? The model picks one category. Regression: the model predicts a continuous number. What will the temperature be tomorrow? How much will this house sell for? How many days until this machine part fails? The output is a point on a number line, not a category. Some models output something richer: not just 'this is a cat' but 'this is a cat with 94% confidence.' That confidence score — called a probability — gives you an idea of how sure the model is, not just what it decided.
Flashcards — click each card to reveal the answer
Classification vs. Regression in the Wild
Knowing whether a task is classification or regression changes how you build and evaluate the model. Classification examples: spam detection (spam or not spam), image recognition (which object is this), medical diagnosis (disease present or absent), sentiment analysis (positive, negative, or neutral review). Regression examples: predicting a student's exam score, estimating how long a delivery will take, forecasting electricity demand, predicting the number of daily visitors to a website. Some tasks look like regression but are really classification — or vice versa. Predicting someone's age from a photo sounds like regression (a number), but many systems actually treat it as classification into age buckets (under 18, 18-30, 30-50, over 50) because clean age buckets are more useful than a specific number. Choosing the right output type for your task is part of good model design.
Before building any model, ask: what exactly does the output need to be? A category? A number? A probability? The answer determines which type of model you need and how you will measure whether it is working.
Fill in the blanks with the correct terms.
A model is trained to predict tomorrow's high temperature in degrees. What type of prediction task is this?
What does a probability output of 0.92 mean when a model classifies an image as 'cat'?
Classify the Tasks
- For each prediction task below, decide whether it is classification or regression, and explain your reasoning in one sentence.
- Task 1: Predicting whether a loan application will be approved or denied.
- Task 2: Predicting how many hours a phone battery will last.
- Task 3: Deciding whether a skin lesion in a photo is benign or malignant.
- Task 4: Predicting the final score of a basketball game.
- Task 5: Categorizing a news article as sports, politics, science, or entertainment.
- Bonus: For any task above, could you convert it from classification to regression, or vice versa? Describe what that would look like and why you might or might not want to.