← Learning Hub
AI foundationsFREE IN BOTH LANGUAGESLesson 09 / 12

AI, ML & learning paradigms

Place supervised, unsupervised, and reinforcement learning in context.

Download notes (.md)

Downloads are text notes. Choose Save as PDF in your browser’s print dialog for a PDF copy.

Understand the concept

Artificial intelligence is a broad field of systems that perform tasks associated with intelligence. Machine learning learns patterns from data. Deep learning is a family of machine-learning methods using multilayer neural networks. A rule-based program can belong to AI without learning from data.

Supervised learning uses labeled examples: spam messages with known labels, or house features with prices. Unsupervised learning explores structure without those target labels, for example clustering similar observations. Reinforcement learning learns a policy through interaction and rewards over time.

Generative models produce content such as text or images. These categories overlap rather than form an exclusive list: a generative model can use deep learning and several training stages. The code below is a transparent rule-based router for illustration, not a trained classifier. It misses cases that its rules do not cover.

Run the example

def route_message(text):
    text = text.lower()
    if "invoice" in text:
        return "billing"
    if "password" in text:
        return "account support"
    return "manual review"

print(route_message("Where is my invoice?"))
print(route_message("Hello there"))

Output / what to expect

billing
manual review

Try it yourself

Categorize: predicting labeled churn, grouping articles without labels, and learning a game policy from rewards. Give one limitation of the router.

View a suggested solution
# Labeled churn: supervised learning.
# Grouping unlabeled articles: unsupervised learning.
# Game policy learned from rewards: reinforcement learning.
# Limitation: "I cannot log in" has no password keyword and goes to manual review.
# A message containing both keywords takes the first matching branch.

Reference: Official documentation ↗

Make it yours.

Run the example and attempt the exercise before marking this lesson complete.

pass the idea on

What did this make you think?

You review and publish the post yourself. Instagram uses your device’s share menu when available; otherwise copy the text and link. Facebook opens the link composer, where you add your thoughts.