MACHINE LEARNING • LESSON 5

Input and Output

A machine learning model receives information as input and produces a prediction as output. The features usually form the input, while the output is the result the model is trying to predict.

THE SIMPLE IDEA

Input goes into the model. Output comes from the model.

In supervised learning, the input is made from features. The model learns from examples where the correct output is already known, and then uses what it learned to predict the output for new data.

01

What Is Input?

Input is the information we give to the machine learning model.

This information is usually represented by features.

INPUT House Size

2,000 sq ft

INPUT Bedrooms

3

INPUT Location

City A

These features give the model information about the house.

02

What Is Output?

Output is the result produced by the model.

When we are training a supervised learning model, we already know the correct output for the training examples. That known answer is called the label or target.

INPUT House Information
OUTPUT Predicted House Price

So, for house price prediction, the output is the price predicted by the model.

03

Input → Model → Output

The entire idea can be reduced to one simple flow.

INPUT Features

Size, bedrooms, location

MODEL Learns Patterns

Uses what it learned

OUTPUT Prediction

House price

04

House Price Example

Imagine we have a house with the following information:

SIZE 2,000 sq ft
BEDROOMS 3
LOCATION City A

These are the inputs to the model.

MODEL OUTPUT Predicted Price: $400,000

The model uses the input features to produce the prediction.

05

Training Input vs Prediction Input

There is an important difference between training and making a prediction for a new example.

DURING TRAINING Input + Known Output

The model sees features together with the correct label and learns the relationship.

FOR A NEW PREDICTION Input → Unknown Output

We give the model new features and ask it to predict the output.

This distinction is important. If the answer is already known for a training example, we can use it to teach the model. For a new example, the answer is what we want the model to predict.

06

Customer Purchase Example

Let's use another example to make the idea clearer.

An online store wants to predict whether a customer will purchase a product.

INPUT Age: 29 Previous Purchases: 5 Website Visits: 12
MODEL Predicts Purchase
OUTPUT Yes

The customer information is the input. The model's prediction — "Yes" — is the output.

07

Output Depends on the Problem

The output is not always the same type of value. It depends on what we are trying to predict.

HOUSE PRICE $400,000

Numerical output.

SPAM DETECTION Spam

Category output.

CUSTOMER PURCHASE Yes / No

Category output.

The input-output structure stays the same, but the type of output changes depending on the machine learning problem.

08

Features, Labels, Input, and Output

Now we can connect the terms we have learned.

FEATURES The information
=
INPUT Information given to the model
+
LABEL Known answer
=
TARGET / OUTPUT Result we want to predict
REMEMBER THIS

Input → Model → Output

Features provide the input information. The model uses learned patterns to produce an output. In supervised learning, the known output in the training data is the label or target.

QUICK CHECK

Identify the Input and Output

We want to predict the price of a house.

Size: 2,000 sq ft Input / Feature
Bedrooms: 3 Input / Feature
Predicted Price: $400,000 Output / Prediction
Answer

The house size and bedrooms are input features. The predicted house price is the model's output.

NEXT TOPIC

Numerical Features

Now that we understand features as inputs, we will look at one important type of feature: numerical features. These are features represented using numbers.