0Pricing
Machine Learning Academy · Lesson

Supervised, Unsupervised, and Reinforcement Learning

Learners will categorize the three main ML paradigms, examine concrete use cases for each, and match real-world problems to the right learning type.

Supervised, Unsupervised, and Reinforcement Learning is a free Machine Learning Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Machine Learning Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Three Learning Paradigms Overview

ML isn't one technique but a family, split by the feedback they learn from. The big three: supervised, unsupervised, and reinforcement learning.

Supervised Learning: Learning with Labels

Supervised learning trains on examples that already have the right answer (a label). It powers most ML you use, for both classification and prediction.

# Supervised learning example: predict house price
from sklearn.linear_model import LinearRegression
import numpy as np

# Features (size in sq ft) and labels (price in $)
X = np.array([[500], [1000], [1500], [2000]])
y = np.array([100000, 200000, 300000, 400000])

model = LinearRegression()
model.fit(X, y)  # supervised: model sees both X and y

# Predict on new data
print(model.predict([[1200]]))  # ~$240,000

Supervised Learning Use Cases

Supervised learning is everywhere: spam filters, medical diagnosis, credit scoring, and image recognition. In each, the model learns from past labeled examples.

Unsupervised Learning: Finding Hidden Structure

Unsupervised learning works with no labels at all. The algorithm explores the data and finds hidden structure on its own — most often by clustering.

# Unsupervised learning example: K-Means clustering
from sklearn.cluster import KMeans
import numpy as np

# No labels — only features
X = np.array([[1, 2], [1.5, 1.8], [5, 8], [8, 8], [1, 0.6], [9, 11]])

kmeans = KMeans(n_clusters=2, random_state=42)
kmeans.fit(X)  # no y — discovers structure on its own

print('Cluster assignments:', kmeans.labels_)
# Automatically finds two groups without any labels

Unsupervised Learning Use Cases

Unsupervised learning shines when labels are too costly: grouping customers, spotting anomalies in network traffic, or finding topics across thousands of articles.

Reinforcement Learning: Learning by Doing

In reinforcement learning, an agent acts in an environment and earns rewards or penalties — learning the best strategy by trial and error, like training a dog. 🐕

Reinforcement Learning Use Cases

Reinforcement learning drives some famous wins: AlphaGo mastering Go through self-play, robots learning to walk, and agents learning to drive in simulation.

Self-Supervised Learning: A Fourth Paradigm

A modern twist is self-supervised learning: the data labels itself. Language models like BERT learn by predicting masked words in a sentence.

Matching Problems to Paradigms

To pick a paradigm, ask: do you have labels? Is the output a category or a number? Is learning reward-driven? A safe default is supervised learning.

Semi-Supervised Learning: Best of Both Worlds

Semi-supervised learning mixes a little labeled data with lots of unlabeled data — perfect when labeling is expensive but raw data is plentiful.

Scikit-learn API for All Paradigms

scikit-learn shines with one consistent API: create an estimator, call fit(), then predict() or transform(). Swapping algorithms takes barely any code.

# Consistent API across paradigms
from sklearn.linear_model import LogisticRegression    # supervised
from sklearn.cluster import KMeans                      # unsupervised
from sklearn.decomposition import PCA                   # unsupervised
import numpy as np

X = np.random.randn(100, 5)
y = np.random.randint(0, 2, 100)

# Supervised
clf = LogisticRegression()
clf.fit(X, y)  # needs labels

# Unsupervised
km = KMeans(n_clusters=3)
km.fit(X)  # no labels needed

pca = PCA(n_components=2)
X_reduced = pca.fit_transform(X)

Quick Check

Test your understanding of Machine Learning with Python concepts from this lesson.

Lesson Recap

Nice work! Supervised learns from labels, unsupervised finds hidden structure, and reinforcement learns by reward. Next: the full ML workflow.

Frequently asked questions

Is the “Supervised, Unsupervised, and Reinforcement Learning” lesson free?

Yes — the full text of “Supervised, Unsupervised, and Reinforcement Learning” is free to read here on the web, and the Machine Learning Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Machine Learning Academy course, upgrade to CoddyKit PRO.

What will I learn in “Supervised, Unsupervised, and Reinforcement Learning”?

Learners will categorize the three main ML paradigms, examine concrete use cases for each, and match real-world problems to the right learning type. You practise Machine Learning Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Machine Learning Academy?

No prior experience is required. Machine Learning Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Supervised, Unsupervised, and Reinforcement Learning” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Machine Learning Academy lesson?

Yes. Every Machine Learning Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Traditional Programming vs Machine Learning
  2. Supervised, Unsupervised, and Reinforcement Learning
  3. The ML Workflow: Data to Prediction
  4. ML in the Real World: Use Cases and Limitations
← Back to Machine Learning Academy