FromZero2AI
CoursesPlaygroundBlog
Support on Ko-fi
AI Fundamentals: From Zero to Your First Model • Module A: What Is AI?Lesson 2: How Machines Learn — The Big Picture
PreviousNext

Lesson 2: How Machines Learn — The Big Picture

Explain the 3 types of ML (supervised, unsupervised, reinforcement); describe the learning loop.

Built with AI for beginners. Free forever.

Support on Ko-fi•About•Blog•Privacy Policy•Terms of Service

To understand AI, we must first understand how it differs from traditional programming.

The Big Flip

In traditional programming, humans write the rules. We provide the computer with data (Input) and a set of instructions (Rules), and the computer calculates the Output.

Traditional vs. ML Simulator

Compare how software is built using hard-coded rules vs learned algorithms.

Task Scenario:
Traditional Programming

Input + Rules ➔ Output

As a developer, you write the logic. The computer reads the input, executes your predefined rule, and returns the output.

77°F
-40°F32°F (Freezing)98.6°F (Body Temp)220°F
Input77°F
Rule (Hand-Coded)C = (F - 32) * 5/9
Output25.0°C
Machine Learning

Input + Output ➔ Rules

You feed input and output examples to the training loop. The computer learns the weights and generates the rule itself!

Example Training Dataset5 examples
Input DataDesired Output
32.0°F0.0°C
50.0°F10.0°C
77.0°F25.0°C
104.0°F40.0°C
212.0°F100.0°C
🧪 Model TesterLocked (Train First)
👈 Click "Train Model" to teach the AI and unlock this tester!

Machine Learning (ML) flips this on its head. Instead of writing the rules, we give the computer the Input and the desired Output, and we ask the computer to figure out the Rules!

Think of it like teaching a child to recognize a dog vs. a cat. You don't give them a rulebook about ear shapes and tail lengths. You point to a dog and say "Dog", then point to a cat and say "Cat". Eventually, they learn the pattern from the examples.

The Three Types of Machine Learning

  • Supervised Learning: Learning from labeled examples. It's like studying with flashcards that have the answers on the back.
  • Unsupervised Learning: Finding patterns without labels. Imagine sorting a giant pile of mixed LEGO bricks by color or shape without anyone telling you what the categories should be.
  • Reinforcement Learning: Learning by trial and error. It's similar to training a puppy with treats—rewarding good behavior and ignoring bad behavior until it figures out the trick.

Exercise: Match the ML Type

Determine which type of learning applies to each scenario. Select a badge to match.

Email spam classificationAn algorithm scans email content to filter out unsolicited messages.
Grouping shoppers by similar habitsAn algorithm groups supermarket customers by purchasing behavior.
An AI learning to play chessA computer chess program improves its strategy through game-play feedback.

The ML Workflow

Building an AI is not just about writing code. It follows a loop: Collect Data ➔ Train Model ➔ Evaluate ➔ Improve ➔ Deploy. In the next lesson, we'll talk about the absolute most important part of this loop: the Data!