"Imagine teaching three students: one with answer keys, one with piles of unlabeled puzzles, and one with only points for winning—that’s machine learning in a nutshell."
Discusses the main types of machine learning: supervised, unsupervised, and reinforcement learning.
Machine learning is really about how feedback arrives. A model can learn from labeled examples, from hidden structure, or from rewards after actions.
Think of it like learning to cook:
A spam filter trained on 50,000 emails marked spam or not spam is supervised. A retailer grouping customers by shopping behavior is unsupervised. A robot learning to walk by falling, adjusting, and getting a higher score for balance is reinforcement learning.
The big question is not "What algorithm?" but "What kind of feedback does the learner get?"
In supervised learning, the dataset includes both the input x and the target y. The goal is to learn a rule that maps inputs to outputs.
Two common jobs:
fraud vs not fraud$425,000A simple example is predicting exam scores from study hours. If a model predicts 82 but the true score is 90, the error might be:
error = true - predicted = 90 - 82 = 8
Training means adjusting the model to reduce errors across many examples.
X = [[2], [4], [6], [8]] # study hours
y = [65, 72, 81, 90] # exam scores
# learn a function so f(5) predicts a score near 76-78
If you have examples with correct answers, supervised learning is usually the first place to look.
In unsupervised learning, you only have inputs—no answer key. The model tries to uncover patterns humans did not explicitly label.
Common tasks include:
Suppose a music app has data on 1 million users: average listening time, favorite genres, skip rate, and number of playlists. If it groups users into "casual," "focused," and "music power" listeners without those labels being provided, that’s unsupervised learning.
The key idea: the model is not predicting a known target. It is organizing, compressing, or finding hidden patterns in the data.
In reinforcement learning (RL), an agent interacts with an environment, takes actions, and receives rewards. Instead of being told the right answer directly, it learns which actions lead to better long-term outcomes.
Picture a game-playing AI:
+10 for scoring, -50 for losingThe challenge is delayed consequences. A move that gives 0 reward now may set up a +100 win later. That makes RL different from supervised learning, where the correct target is given immediately.
Examples:
Use RL when a system must act repeatedly and learn from rewards, not labels.
Test your understanding with inline MCQs, track your mastery score, and get scheduled review reminders — free.
Start learning for free