Machine LearningTypes of Machine Learning

"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."

Types of Machine Learning

Discusses the main types of machine learning: supervised, unsupervised, and reinforcement learning.

~20 min readPart of: Machine Learning

Three families of machine 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:

  • Supervised learning: you get recipes with the correct final dish labeled.
  • Unsupervised learning: you sort ingredients into groups without being told the names.
  • Reinforcement learning: you try actions in a kitchen game and earn points for tasty meals.

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?"

Supervised learning: learning from answer keys

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:

  • Classification: predict a category, like fraud vs not fraud
  • Regression: predict a number, like house price = $425,000

A 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.

Unsupervised learning: discovering structure without labels

In unsupervised learning, you only have inputs—no answer key. The model tries to uncover patterns humans did not explicitly label.

Common tasks include:

  • Clustering: grouping similar items, like customers into 3 shopping styles
  • Dimensionality reduction: compressing data while keeping important structure
  • Anomaly detection: spotting unusual behavior, like a credit card purchase at 3 a.m. in a new country

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.

Reinforcement learning: learning by trial, error, and reward

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:

  • State: the current board position
  • Action: move left, jump, attack
  • Reward: +10 for scoring, -50 for losing

The 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:

  • AlphaGo learning board strategies
  • A warehouse robot optimizing routes
  • An ad system choosing which ad to show next to maximize clicks over time

Use RL when a system must act repeatedly and learn from rewards, not labels.

Study this interactively on Wisdemic

Test your understanding with inline MCQs, track your mastery score, and get scheduled review reminders — free.

Start learning for free
← Previous
Introduction to Machine Learning
Next →
Data Preprocessing