MACHINE LEARNING • LESSON 3

Complete ML Workflow

A machine learning project is not just about training a model. It is a complete process that starts with collecting useful data and continues through preparation, training, prediction, evaluation, and improvement.

THE CORE IDEA

Machine learning is a process, not just a model.

A successful ML system moves through several connected steps. Each step affects the next one. Good data helps create a better model, good training produces useful predictions, and evaluation tells us whether the model needs improvement.

01

The Complete Workflow

The basic machine learning workflow can be summarized like this:

01 Collect Data
02 Prepare Data
03 Train Model
04 Make Predictions
05 Evaluate
06 Improve

After improving the model, we may train and evaluate it again. So the workflow is often a cycle rather than a straight line.

02

Step 1 — Collect Data

A machine learning model needs data to learn from.

The data should be relevant to the problem we are trying to solve.

PROBLEM Predict house prices
DATA Previous house information

For example, we could collect house size, number of bedrooms, location, age, and previous selling prices.

Without useful data, there is very little for the model to learn from.

03

Step 2 — Prepare the Data

Raw data is rarely ready to be given directly to a machine learning model.

We may need to handle missing values, remove duplicate records, fix incorrect data, encode categories, and prepare the features.

RAW DATA Messy or incomplete
PREPARED DATA Clean and usable

Better preparation gives the model better information to learn from.

04

Step 3 — Train the Model

Now the prepared training data is given to a machine learning algorithm.

The model studies the examples and learns patterns between the input data and the expected output.

TRAINING DATA House features + known prices
TRAINING Model learns patterns
RESULT Trained model
05

Step 4 — Make Predictions

Once the model has learned from the training data, we can give it new data.

The trained model uses the patterns it learned to produce a prediction.

NEW HOUSE 1,800 sq ft, 3 bedrooms
TRAINED MODEL Uses learned patterns
PREDICTION $350,000
06

Step 5 — Evaluate the Predictions

A prediction is not automatically correct.

We compare the model's predictions with actual results to understand how well the model is performing.

PREDICTION $350,000
vs
ACTUAL $370,000
EVALUATE How good was the prediction?

Evaluation gives us evidence about whether the model is performing well enough.

07

Step 6 — Improve the Model

If the model is not performing well enough, we investigate the problem and make improvements.

The problem might be related to the data, features, model choice, or training process.

EVALUATION Predictions are poor
INVESTIGATE Find the problem
IMPROVE Make a useful change

Then we train and evaluate the model again.

08

Complete Example — House Price Prediction

Let's put the entire workflow together.

01 Collect

Previous house data

02 Prepare

Clean the data

03 Train

Learn patterns

04 Predict

Predict new prices

05 Evaluate

Compare results

06 Improve

Make the model better

Suppose the model predicts the following price for a new house:

NEW HOUSE 2,000 sq ft

4 bedrooms

MODEL PREDICTION $420,000
ACTUAL PRICE $450,000

The model was not exactly correct, so we evaluate the difference and investigate whether the model can be improved.

09

The Workflow Is a Cycle

The most important thing to understand is that machine learning usually does not finish after the first model is trained.

COLLECT Data
PREPARE Data
TRAIN Model
PREDICT Results
EVALUATE Performance
IMPROVE Model

After improvement, we may go through training and evaluation again.

This cycle continues until the model performs well enough for the problem we are trying to solve.

KEY IDEA

Machine Learning Is a Continuous Workflow.

We collect data, prepare it, train a model, make predictions, evaluate those predictions, and improve the model when necessary. The goal is to create a model that performs well on new data.

QUICK CHECK

Put These Steps in the Correct Order

Imagine you want to build a model that predicts house prices.

Correct Order

1. Collect useful house data.

2. Prepare and clean the data.

3. Train the model.

4. Use the trained model to make predictions.

5. Evaluate the predictions.

6. Improve the model if necessary.

LESSON 3 COMPLETE

You Now Understand the ML Workflow

You have seen how data moves through a machine learning system—from collecting and preparing data to training, prediction, evaluation, and improvement.

Collect Prepare Train Predict Evaluate Improve
NEXT LESSON

Lesson 4 — Training, Validation, and Test Data

We now know the overall ML workflow. Next, we will learn why machine learning data is divided into training, validation, and test data, and what each part is used for.