MACHINE LEARNING • LESSON 3

The ML Workflow

Machine learning is not just about training a model. A real ML project follows a series of steps that turn a real-world problem into a working prediction system.

THE CORE IDEA

Machine learning is a process, not just an algorithm.

You start with a problem, collect useful data, prepare that data, train a model, make predictions, evaluate the results, and improve the model when necessary.

01

Start With a Problem

Every machine learning project should begin with a clear problem.

For example, an online store may want to predict whether a customer is likely to buy a product.

Before writing Python code, we need to understand exactly what we are trying to predict.

EXAMPLE Can we predict whether a customer will buy a product?

This becomes the goal of our machine learning project.

02

The Complete ML Workflow

Once the problem is clear, the project moves through several important stages.

STEP 1 Define the Problem

Decide what you want the model to predict.

STEP 2 Collect Data

Gather useful examples related to the problem.

STEP 3 Prepare Data

Clean and organize the data for learning.

STEP 4 Train the Model

Let the model learn patterns from the data.

STEP 5 Make Predictions

Use the trained model on new data.

STEP 6 Evaluate

Check how well the model performs.

STEP 7 Improve

Improve the model when its results are not good enough.

03

A Simple Example

Let's use house-price prediction to understand the entire workflow.

Step What Happens?
Define the Problem Predict the price of a house.
Collect Data Gather house sizes, bedrooms, locations, and prices.
Prepare Data Clean missing or incorrect information.
Train Model Let the model learn relationships between house information and price.
Make Prediction Predict the price of a new house.
Evaluate Compare predictions with actual prices.
Improve Improve the model if its predictions are not accurate enough.
04

Why Does the Order Matter?

These steps are connected.

A model cannot learn useful patterns from bad or irrelevant data.

Similarly, training a model does not mean the model is automatically good. We still need to test its predictions and measure its performance.

Important:

A sophisticated algorithm cannot magically fix poor data or a badly defined problem.

05

The Workflow Is Usually Iterative

The process does not always end after the first model is trained.

If the model performs poorly, we may go back and improve the data, features, model, or training process.

TRAIN Build a Model
EVALUATE Check Results
IMPROVE Make It Better
TRAIN AGAIN Repeat When Needed

This is why machine learning development is often an iterative process rather than a one-time operation.

06

A Real-World View

Imagine an e-commerce company wants to predict whether a customer will purchase a product.

PROBLEM Predict customer purchase
DATA Customer behavior
MODEL Learn patterns
RESULT Purchase prediction
07

What You Will Learn in the Next Pages

The workflow is easy to understand at a high level. The next pages will examine each important step in more detail.

NEXT Collecting Data

Where machine learning data comes from and what makes data useful.

AFTER THAT Preparing Data

How raw data is cleaned and prepared for a model.

KEY IDEA

A Machine Learning Project Follows a Process.

Define the problem, collect data, prepare the data, train a model, make predictions, evaluate the results, and improve the model when necessary.

QUICK CHECK

What Comes After Training?

Suppose you have trained a model to predict house prices. Is the project finished?

Answer

No.

We need to use the model to make predictions and then evaluate how well those predictions perform.

If the results are poor, we can improve the model and repeat the process.

NEXT TOPIC

Collecting Data

Now that you understand the complete ML workflow, we will look at the first major practical step: collecting the data that the model will learn from.