Chapter 04 · Section I · 14 min read
The types of machine learning
Supervised, unsupervised, reinforcement — three modes of learning, explained with examples you can hold in your hand.
There are three broad ways to teach a machine. Almost every real machine learning system in production today — Khalti’s fraud model, Pathao’s route ranker, the Devanagari OCR on your phone, ChatGPT — is one of these three, or a combination. The choice depends on the kind of data you have and the kind of question you are asking.
In this section we lay out the three modes plainly, with one Nepali example for each. The rest of the chapter zooms in on the specific algorithms.
Supervised learning: the most common mode
In supervised learning, you have data with the right answer attached. Each example is a pair: an input, and the correct output. The model’s job is to find a function that maps inputs to outputs, using these labelled examples as guidance.
Some quick examples:
- Khalti fraud detection. Each historical transaction is labelled “fraud” or “not fraud”. The model learns to map a fresh transaction to a fraud probability.
- Devanagari OCR. Each training image is a photo of a Devanagari letter paired with a label saying which letter it is. The model learns to map images to letters.
- Crop-yield prediction in Chitwan. Each historical paddy season is labelled with the yield in tons. The model learns to map weather, rainfall, and planting dates to expected yield.
Supervised learning is the workhorse of applied AI. Almost every AI deployment you have ever interacted with is, under the hood, supervised. It is also the easiest to evaluate: you hold out some labelled examples, ask the model to guess, and count how often it is right.
The catch: getting labels is expensive. Someone — often many someones — had to look at every training example and write down the answer. For a Nepali Devanagari OCR system, that’s tens of thousands of labelled letter images. For Khalti fraud, it’s millions of transactions reviewed by humans (or by other systems). The cost of labelling, not the cost of the model, is usually the bottleneck in production AI.
Unsupervised learning: finding structure without labels
In unsupervised learning, you have data, but no labels. The model’s job is to find structure — patterns, clusters, simpler representations — without being told what to look for.
Two common kinds:
- Clustering. Group similar examples. Take 100,000 Pathao trips and ask: are there natural “kinds of trip”? The algorithm might find clusters like short downtown rides, long airport runs, late-night commutes from Thamel. No human told it those exist; it discovered them.
- Dimensionality reduction. Compress data without losing too much. A Khalti user’s behaviour can be described by hundreds of features; an unsupervised algorithm can compress those into, say, twenty dimensions that still capture the bulk of what’s interesting.
Unsupervised learning is useful when you don’t know what you’re looking for, when labels are too expensive to collect, or when you want to explore a dataset before deciding what to model.
The catch: evaluating an unsupervised model is hard. There is no “right answer” to compare against. You can ask whether the clusters look reasonable to a human, or whether they help downstream tasks — but these are softer measurements than the accuracy you get with labels.
Reinforcement learning: learning from consequences
Reinforcement learning is the most exotic of the three. The model is an agent that takes actions in some environment, receives a reward (or punishment), and updates its strategy. There are no labelled examples and no fixed dataset; the agent generates its own experience by acting.
Examples:
- AlphaGo. The agent plays the game Go. The reward is +1 for winning, −1 for losing. The agent plays itself millions of times, gradually shifting its policy toward moves that lead to wins.
- Robot locomotion. A four-legged robot in a lab in Tribhuvan University learns to walk by trying movements; reward is forward velocity, punishment is falling over.
- Resource allocation in a data centre. An agent decides how to schedule workloads to minimise electricity use; reward is energy saved.
Reinforcement learning is powerful when the right behaviour is hard to specify directly but easy to evaluate after the fact. It is also delicate: bad reward functions produce dangerous behaviour, and the agent often discovers loopholes you didn’t anticipate.
The catch: RL needs millions or billions of episodes of experience, which is fine in a simulator (Go, video games) but painfully expensive in the real world (a robot can only walk so many hours per day before something breaks). Most “RL” success stories in 2026 are still in simulated environments.
Which one fits your problem?
Use this rough decision tree:
- Do you have a labelled dataset of past examples? Use supervised learning.
- Do you have data but no labels, and you want to explore the structure? Use unsupervised learning.
- Are you controlling something that acts in an environment, with feedback about how it does? Use reinforcement learning.
Many real systems combine the three. ChatGPT was trained with supervised learning (on text), then refined with reinforcement learning (from human feedback). Khalti’s fraud system uses supervised learning for classification and unsupervised clustering to discover new kinds of fraud that emerge over time. The boundaries are useful but porous.
The labels behind the labels
One more thing, because it shows up in every real deployment: labels are not free, and labels are not neutral. Someone decided what counts as fraud, what counts as a positive sentiment, what counts as a correct Devanagari letter. Those decisions are baked into every supervised model.
If the labellers were unrepresentative — say, all from one community, or all working under time pressure that made them careless — the model will inherit their blind spots. A facial recognition system labelled mostly by Europeans for European faces will not work well in Asan. This is not a bug in the algorithm; it is a feature of how supervised learning works.
The implication for Nepali AI: building local capacity to label data is at least as important as building capacity to train models. Both are bottlenecks. Only one gets covered in tech magazines.
Check your understanding
Quick check
—A health NGO has 50,000 anonymised survey responses from villages across Lumbini, with no labels. They want to understand what 'kinds of household' exist in the data. Which paradigm fits?
What comes next
We’ve sketched the three modes. The next section dives into the simplest possible supervised classifier — nearest neighbour — which does almost no work and still performs surprisingly well. It is a great mental model for everything else that comes after.