Koinder Practitioner Track18+← My LearningAbout the trackClubhouse

Machine Learning From Zero: Teach a Machine to Discover a Rule

No assumed knowledge. Kodi first lets you experience each idea in ordinary life, then gives the idea its technical name, then lets you touch it, break it, code it and use it like a practitioner.

Module 4 · Practitioner Track · Zero-Knowledge → Creator → Practitioner
WHY FIRSTSTORY BEFORE JARGONPICTUREPLAYGROUNDBREAK ITCODE ITWORKPLACE
👁 SEE❓ GUESS✋ TOUCH🗣 EXPLAIN🛠 BUILD

The Clubhouse Rule

Experience → Question → Familiar story → Principle → Picture → Technical name → Playground → Mistake → Fix → Code → Real work → Teach it back.

Kodi will try not to use a technical word before you have experienced the idea that the word names.

Lesson 1

Why Would a Machine Need to Learn?

Before “machine learning”, understand the problem that ordinary rules cannot always solve.

🍊 The Fruit Shop Problem

You own a fruit shop. Your new worker must separate ripe oranges from unripe oranges.

riperipenot ripenot ripe
Do not memorise vocabulary yet. Notice that examples contain clues.

You could write a rule: “If orange colour is deep enough, call it ripe.” But what about a ripe fruit that is still partly green? What about softness? Smell? Variety? Damage?

When the exact rule is easy to state, write the rule. When useful patterns are difficult to hand-write but examples exist, learning from examples becomes attractive.

🎮 Playground · Rule Writer vs Changing World

Choose a rule for spam. Then Kodi changes the message.

🤖 Now We Can Name the Idea

Normal programming: a human writes the rule and the computer applies it.

RULE
+
DATA
ANSWER

One important form of machine learning: we provide examples and known answers, and an algorithm estimates a model that can predict answers for new examples.

EXAMPLES
+
KNOWN ANSWERS
LEARNING
MODEL
Lesson 2

Teach Kodi Without Writing the Rule

Experience supervised learning before learning its vocabulary.

🥭 “Kodi Has Never Seen a Ripe Mango”

You are the teacher. Kodi sees four mangoes and you tell Kodi the correct answer for each one.

ColourFirmnessSmellYour answer
YellowSoftSweetRipe
GreenHardLittle smellNot ripe
Yellow-greenSlightly softSweetRipe
GreenVery hardLittle smellNot ripe
Question: Did you give Kodi a mathematical formula for ripeness? No. You supplied examples, clues and correct outcomes.

🎮 Playground · New Mango

A new mango is yellow-green, soft and smells sweet. Kodi has never seen this exact mango. What should a useful learner do?

🧠 Vocabulary Reveal

Training exampleOne example used while the machine is learning.
FeatureA clue or measurable input: colour, firmness, smell.
Label / targetThe answer we want to learn or predict: ripe/not ripe.
TrainingThe process of adjusting a model from examples.
ModelThe learned mathematical mechanism used to make predictions.
Prediction / inferenceUsing the trained model on a new example.
You experienced the idea first. Its technical family name is supervised learning: learning from examples where the desired answer is known during training.
Lesson 3

What Does “Learning” Actually Mean?

Not magic. Not consciousness. Parameters are adjusted so predictions better match examples.

🎚 Imagine a Scoring Machine

Suppose Kodi is estimating loan risk. Each clue contributes some influence to a score. In a simple model, learning can mean finding useful numerical settings—often called parameters or weights—from data.

steady incomestable jobheavy debtcombineweighted cluesriskprediction
A visual metaphor for a simple weighted model. Real algorithms vary greatly.

🎮 Playground · Adjust the Weights Yourself

0score for sample applicant
?prediction
Lesson 4

How Does the Machine Know It Is Wrong?

Learning needs feedback: compare prediction with truth, measure error, adjust, repeat.

The Learning Loop

Make prediction
Compare with truth
Measure error
Adjust model

The function that measures how wrong a model is is often called a loss function. Different tasks use different losses.

🎯 Playground · Find the Better Line

Imagine actual house price = 50 + 3 × size. Move Kodi's slope closer to the pattern and watch average error fall.

0average absolute error
Lesson 5

Two Supervised Questions: “Which Kind?” and “How Much?”

📦 Which category?

Spam/not spam, diseased/healthy, churn/stay.

Technical name: classification.

📏 How much?

House price, demand, delivery time, revenue.

Technical name: regression.

🎮 Playground · Sort the Question

Lesson 6

What If Nobody Knows the Answers?

Now remove the labels and see what kind of learning remains possible.

🛒 40,000 Shoppers, No Customer Types

A supermarket has purchase histories but nobody has labelled customers “VIP”, “bargain hunter” or “at risk”. You can still search for customers that behave similarly.

When there are no target labels and we search for structure in the data, we are in unsupervised learning.

🎮 Playground · Let Groups Emerge

Lesson 7

What If There Are No Correct Answers, Only Consequences?

🤖 Kodi in a Maze

Kodi can move left, right, up or down. Nobody provides the correct move for every square.

Move
Consequence
Reward / penalty
Try again

Reach the apple: +10. Hit a wall: −2. Every unnecessary move: −1.

Learning which actions tend to produce better future rewards is the central idea of reinforcement learning.

🎮 Playground · Experience Shapes Preference

A +20 tries
B −10 tries
C +50 tries
Lesson 8

Before Modelling: What Is One Row?

A surprisingly important practitioner question.

💼 “Predict Customer Churn” Is Still Too Vague

What exactly is a customer example? One customer ever? One customer each month? One customer at a particular prediction date?

Define the business decision.
Define the prediction moment.
Define what one row represents.
Define the target precisely.
Use only features legitimately available at that moment.

🧭 Playground · Frame the Problem

Lesson 9

Data Is the Raw Material — and It Is Usually Messy

🧺 Imagine Cooking With Unsorted Ingredients

Some tomatoes are rotten, some labels are missing, salt is stored in a sugar bag, and the same onion appears twice on the inventory list. A brilliant recipe cannot rescue ingredients you do not understand.

Machine learning begins with understanding the data-generating process, not with clicking “train”.

🕵️ Playground · Data Detective

Click suspicious cells.

CustomerStateSalesDate
AmakaLagos₦5,00012/4/26
AMAKAlagos500012-04-2026
EmekaLAGN/AApril 12
JohnAbuja₦-90014/04/26
 ABUJA7300 
0issues noticed
Lesson 10

Features: Turn Raw History Into Useful Clues

🧠 Humans Do This Naturally

If you see four purchases spread across months, you may mentally ask: How recently did this person buy? How often? How much do they usually spend?

Those derived clues can become model features.

🏭 Playground · Feature Factory

DateAmount
Jan 2₦4,300
Jan 18₦12,000
Feb 1₦2,500
Apr 9₦7,600
Lesson 11

The Exam Analogy: Train, Validate, Test

TRAINstudy materialVALIDATEmock examinationTESTunseen final exam
The test set should estimate performance on unseen data, not become another study sheet.
Generalisation means performing well on new examples, not merely remembering the examples used during training.
Lesson 12

Overfitting: The Student Who Memorised the Answers

📚 Ada Scores 100% on the Practice Sheet

But the teacher changes the numbers in the final exam and Ada fails. She memorised the sheet instead of learning the underlying method.

A model that fits training data extremely closely but performs poorly on new data is overfitting.

🎮 Playground · Make the Model Too Clever

0%training score
0%unseen score
Lesson 13

Data Leakage: Kodi Saw the Answer Sheet

📝 The 100% Student

Kodi gets every exam question right. Then you discover the final answers were printed faintly at the bottom of every page.

That is not intelligence. The evaluation has been contaminated.

Data leakage occurs when information unavailable at legitimate prediction time, or otherwise improperly connected to the outcome, enters training/evaluation and makes performance misleading.

🚨 Playground · Catch the Answer Sheet

Lesson 14

Accuracy Can Be a Beautiful Lie

🚨 The Security Guard Who Says “Everybody Is Innocent”

If only 1 person in 1,000 is a thief, the guard can say “innocent” to everybody and be correct 99.9% of the time—while catching zero thieves.

A metric is useful only when it reflects the mistakes that matter.

Confusion Matrix — Four Possible Outcomes

Actually fraud
Actually normal
Predict fraud
True positive
caught fraud
False positive
false alarm
Predict normal
False negative
missed fraud
True negative
correct clear
RecallOf all real positives, how many did we catch?
PrecisionOf all cases we called positive, how many really were positive?

🎚 Playground · Security Threshold

0%recall
0%precision
0%false alarms
Lesson 15

Models Are Different Tools, Not Magic Rankings

Only now—after you understand the problem, data, target, features, generalisation and evaluation—do model names become useful.

Linear Regression

Fits a numerical relationship. Good baseline for some regression problems.

Logistic Regression

Estimates class probability using a relatively simple decision structure.

Decision Tree

Learns branching questions. Easy to visualise; deep trees can overfit.

Random Forest

Combines many varied trees so their votes can be more robust.

Gradient Boosting

Builds models sequentially to correct previous errors; powerful on many tabular tasks.

Neural Networks

Flexible layered models useful across images, text, audio and many complex tasks.

The practitioner question is not “Which algorithm is coolest?” It is “Which approach is justified by this problem, data, constraints, baseline and evaluation?”
Lesson 16

Reward Hacking: The Machine Did Exactly What You Asked

🧹 The Cleaning Robot

You reward a robot every time it collects dirt. It discovers that dumping dirt from its own bin and collecting it again earns endless points.

The robot did not misunderstand the score. You wrote a score that failed to capture the real goal.

🎮 Playground · Fix the Reward

Lesson 17

Bias and Fairness: Learning History Can Repeat History

⚖️ “The Data Says So” Is Not the End of the Conversation

Historical records can contain patterns created by previous human decisions, unequal access, measurement choices or missing populations. A model can scale those patterns.

History
Training data
Learned pattern
Decisions at scale

Responsible ML asks who may be harmed, whether features are legitimate, how error rates differ, what human oversight exists and how decisions can be challenged.

Lesson 18

Distribution Shift: Yesterday's World Is Not Today's World

🌍 The Recipe Changed

A demand model learns from years when prices, policy and customer behaviour followed one pattern. Then a major event changes the environment. The code may still run perfectly while the model becomes less useful.

When the live world no longer resembles the world represented in training data, model performance can degrade. This family of problems is often discussed as distribution shift or drift.

🎮 Playground · Move the World

0%simulated performance
Lowmonitoring risk
Lesson 19

Now Read the Python — Every Line Has a Meaning

First Read It in English

Choose the clues (features).
Choose the answer to learn (target).
Keep some examples unseen.
Create a model.
Train it on training examples.
Predict unseen examples.
Measure mistakes.

Then Read the Code

from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report

X = df[["days_since_last_order", "orders_90d", "spend_90d"]]
y = df["churned_30d"]

X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.20, random_state=42, stratify=y
)

model = RandomForestClassifier(random_state=42)
model.fit(X_train, y_train)

predictions = model.predict(X_test)
print(classification_report(y_test, predictions))

Memory hook

X = clues. y = answer. fit = learn. predict = use what was learned. metrics = check whether it actually worked.

Lesson 20

A Notebook Is Not Yet a Working Product

🚀 From Model to Real System

Business data
Validation
Feature pipeline
Model
API
Application
Action
Logs + outcomes
Monitoring
Retrain / rollback

This surrounding discipline—versioning, serving, monitoring, reproducibility, retraining and rollback—is part of MLOps.

Lesson 21

What an ML Practitioner Actually Does

💼 Tuesday Morning

Clarify what the business is really trying to decide.
Find out whether the required data exists.
Clean inconsistent fields and investigate missing values.
Build features without leaking the future.
Establish a simple baseline.
Train and compare justified models.
Choose metrics based on the cost of mistakes.
Inspect errors instead of worshipping one score.
Serve the prediction to another system.
Monitor whether the live world is changing.
Lesson 22

Capstone: Save KoMart

Now combine the principles rather than answering isolated questions.

🏢 Mission

KoMart has 150,000 transaction records. Management says, “Customers are disappearing. Help us intervene before they leave.”

Your deliverable is not merely a model. It is a defensible ML system and a portfolio story.

🏆 Practitioner Evidence

🧠 Final Neural Pathway

Problem → Examples → Features → Target → Learn → Validate → Predict → Measure → Diagnose → Deploy → Monitor → Improve.

If the learner can explain that chain in ordinary language, demonstrate it in code, and defend the choices in a real project, the vocabulary is no longer floating knowledge. It has a structure.

🤖

One question before we start

The Practitioner track is built for adults. It assumes you are ready to deploy real systems that real strangers may use, and to be answerable for what they do.

This check is used to enforce the adult Practitioner track. Your server-side gate controls access.