🔷 WEEK 2 Lesson 6
Title:
Model Lifecycle & Production Thinking
Theme:
From Notebook Experiments → Real AI Systems
Why This Lesson Exists
Most beginners learn machine learning like this:
Load data → Train model → Accuracy → Done ✓
But real-world AI works differently.
In industry:
AI is a living system, not a one-time model.
Models must be:
built,
deployed,
watched,
repaired,
retrained continuously.
This lesson introduces production thinking — the mindset used by professional AI teams...
Learning Objectives
By the end of this lesson, students will:
✔ Understand the complete AI lifecycle
✔ Know how models move into production
✔ Recognize dataset drift and model decay
✔ Learn monitoring and iteration principles
✔ Think like AI system architects
The AI System Lifecycle
The lifecycle has 7 connected stages.
Text
Data → Training → Evaluation → Deployment → Monitoring → Feedback → Iteration.
1. Data Collection
AI begins with data — always.
Sources of Data
Databases
Sensors
User activity
APIs
Surveys
Logs
Transactions
Example (African Context)
Fraud detection system collects:
transaction amount
location
device type
time of transaction
historical behavior
Key Principle
Better data beats better algorithms.
Questions Students Must Ask
Is data representative?
Is data biased?
Is data recent?
Is data legal to use?
2. Training
Training = teaching the model patterns.
Python
Copy code
model.fit(X_train, y_train)
During training the model learns relationships between features and outcomes.
What Happens Internally
The algorithm adjusts parameters to minimize error.
Students should understand:
training is optimization
not intelligence
not understanding
Important Concept
Training data ≠ real world.
3. Evaluation
Before deployment, we test performance.
Common Metrics
Problem Type
Metrics
Classification
Accuracy, Precision, Recall
Regression
MAE, RMSE
Imbalanced data
F1-score
Example
Fraud detection:
Accuracy: 95%
But fraud cases missed ❌
Hence: Precision & Recall matter more.
Validation Split
Python
train_test_split()
Prevents overfitting.
4. Deployment
Deployment = making AI usable by real people.
The model leaves the notebook.
Deployment Forms
Web API
Mobile app
Backend service
Edge device
Dashboard integration
Simplified Flow
Text
User Input → API → Model → Prediction → Application Response
Example
AFRA platform risk scoring:
User transaction → model predicts risk → system approves or flags.
5. Monitoring (Most Ignored Step)
After deployment, performance changes.
Why?
Because the world changes.
What We Monitor
prediction accuracy
input data distribution
latency
error rates
business impact
Example
Customer behavior changes during holidays → model accuracy drops.
6. Dataset Drift (Critical Concept)
Dataset drift happens when real-world data changes over time.
Types of Drift
Data Drift
Input patterns change.
Example:
new payment methods appear.
Concept Drift
Relationship changes.
Example:
fraudsters change tactics.
Visual Idea
Text
Training Data (Past)
↓
Real World (Present)
≠
Model assumptions break
Consequence
Models silently become worse.
This is called:
Model Decay.
7. Iteration (AI Never Finishes)
Professional AI cycle:
Text
Collect New Data
↓
Retrain Model
↓
Evaluate Again
↓
Redeploy
AI systems evolve continuously.
Production Thinking Mindset
Students move from:
❌ “I built a model.”
to
✅ “I built a system that learns over time.”
Real Industry Workflow
Text
Data Engineers → prepare pipelines
Data Scientists → build models
ML Engineers → deploy systems
Product Teams → monitor impact
Modern role: 👉 Full-stack AI thinker (what this course is training).
Mini System Architecture Example
Text
User App
↓
Backend API
↓
Feature Processing
↓
ML Model
↓
Prediction Database
↓
Monitoring Dashboard
Students understand AI as infrastructure.
Hands-On Concept Exercise
Students design lifecycle for:
Loan Approval AI
They must define:
Data source
Training process
Evaluation metric
Deployment method
Monitoring strategy
Retraining trigger
(No coding — system thinking.).
Common Beginner Mistakes
❌ Training once and never updating
❌ Ignoring monitoring
❌ Measuring only accuracy
❌ Deploying without validation
❌ Forgetting data versioning
Golden Rule of Production AI
Text
The hardest part of AI is not building models.
It is keeping them working.
Why This Lesson Matters Before Deep ML
Students now understand:
AI is engineering
AI is lifecycle management
AI is continuous learning systems
Deep learning later becomes meaningful because they know where models fit.
Week 2 Integration Summary
Students can now:
✓ Load and explore data (Pandas)
✓ Clean datasets systematically
✓ Build transformation pipelines
✓ Engineer meaningful features
✓ Understand full AI lifecycle
They have crossed from:
Beginner Coders → Junior AI Practitioners
Outcome Achieved
Students now understand the complete AI system lifecycle before studying advanced machine learning.
Week 3 — Introduction to Machine Learning Proper
(where models finally enter — but now students are prepared like professionals, not beginners).
Powered by Soft AI Africa | Training the Next Generation of AI Leaders in Africa.