WEEK 2 Lesson 1
Title: Understanding Datasets & Data Splits.
Theme: Engineering Data Before Models
Core Principle: Bad Data = Bad Model
Lesson Objective
By the end of this lesson, students will:
✔ Understand how datasets are structured
✔ Differentiate features vs labels
✔ Apply proper train/validation/test splits
✔ Detect and avoid data leakage
✔ Think with a dataset documentation mindset
This lesson builds the foundation of reliable AI systems.
1. What Is a Dataset?
A dataset is a structured collection of data used to train or evaluate a model.
In AI systems, datasets usually contain:
° Rows → observations (examples)
° Columns → features (attributes)
° Optional column → label/target (what we want to predict)
Example 1: Structured Dataset (Tabular)
See the data tables below.



Examples:
Loan approval dataset
Hospital patient dataset
Agricultural yield dataset
School performance dataset
Each row = one instance
Each column = one feature.
Example 2. Unstructured Dataset (See below illustrations)




Examples of unstructured dataset:
a. Text (news articles, SMS data)
b. Images (crop disease photos)
c. Audio (local language recordings)
d. Video (traffic footage)
Unstructured data must often be transformed before modeling.
2. Features vs Labels
This is one of the most important concepts in AI.
🔹 Features (X)
Inputs used by the model.
Examples:
Age
Income
Temperature
Text message content
Image pixels
🔹 Label (y)
The output we want to predict.
Examples:
Approved / Not approved
Disease type
Sentiment (Positive/Negative)
Crop healthy vs diseased
Simple Example:
Age | Income | Loan Approved
35 | 50000 | Yes
Features → Age, Income
Label → Loan Approved
Without a clear label, supervised learning cannot happen.
3. Train / Validation / Test Split
This is where many beginners fail.
Why split data?
If you train and test on the same data:
Your model memorizes.
You get fake performance.
You deploy failure.
Proper Split Structure below.




No
Typical ratios:
70% → Training
15% → Validation
15% → Test
🔹 Training Set
Used to train the model.
🔹 Validation Set
Used to tune hyperparameters and adjust model choices.
🔹 Test Set
Used once. Only at the end. For final unbiased evaluation.
4. What Is Data Leakage?
Data leakage happens when:
Information from the future leaks into training.
This gives artificially high performance.
Example of Leakage
Imagine predicting loan default:
If your dataset includes:
“Loan Repaid Status After 6 Months”
And you use that as a feature…
You are cheating.
The model sees the answer indirectly.
Common Leakage Sources:
Mixing train and test data
Scaling entire dataset before splitting
Using post-outcome features
Time-series data shuffled incorrectly.
Leakage destroys trust.
Engineers must guard against it.
5. Dataset Documentation Mindset
Professional AI engineers document datasets.
This prevents misuse and bias.
A good dataset document includes:
Source of data
Date collected
Number of samples
Number of features
Label definition
Known limitations
Known biases
Missing value summary
This is inspired by practices used in major AI research institutions like Google Research and OpenAI.
Serious systems require serious documentation.
African Context Awareness
When working with African datasets:
Language diversity matters
Infrastructure gaps affect data quality
Informal sector data may be inconsistent
Historical bias may exist in financial or health datasets
Data is not neutral.
Engineers must think ethically.
Mini Practical Exercise
Students must:
1. Download a public CSV dataset.
2. Identify:
° Features
° Label
3. Perform:
° 70/15/15 split
4. Write 5 bullet points documenting the dataset.
Identify at least one possible leakage risk.
5. Deliverable: Short technical summary.
Lesson 1 Outcome
By the end of this lesson, students:
✔ Understand structured vs unstructured data
✔ Identify features and labels
✔ Perform proper dataset split
✔ Detect leakage risks
✔ Think like responsible AI engineers
Engineering Principle of the Week
“The model is only as good as the data discipline behind it.”
Next:
🔷 Week 2 — Lesson 2: Pandas for Data Loading & Exploration
Powered by Soft AI Africa | Training the Next Generation of AI Leaders in Africa.