MegaMaester

Artificial Intelligence · Lesson 1

What Is Machine Learning?

beginner16 min · 13 cards
Start here

What Is Machine Learning?

How machine learning learns patterns from data instead of hand-written rules, how it nests inside AI and deep learning, and why training differs from inference.

Concept 1 of 10

Why this matters

Almost every system now sold as "AI" — a recommendation feed, a fraud alert, a voice assistant — is a machine learning system underneath. A system that learned from examples cannot be read like a rulebook; it can only be tested against reality. This is the instinct Statistics and Critical Thinking cultivate: trust what has been measured, not what is asserted, and mind the gap between a confident output and a correct one.

Concept 2 of 10

Core concepts

From rules to patterns

Traditional software runs on instructions a person wrote: if this, then that. Machine learning inverts that. Instead of writing rules, you supply many examples and let an algorithm find the patterns linking inputs to outcomes. Nobody tells the system which phrasing signals spam; it infers the association from thousands of messages already labelled spam or not. The rules live as numbers the system tuned for itself, not sentences a programmer typed.

A subset of AI

Machine learning is one branch of artificial intelligence, not a synonym for it. AI is the broad field of building systems that do things we associate with intelligence, and some of it does no learning at all — a chess engine searching moves. Inside AI sits machine learning, which learns from data; inside that sits deep learning, built on multilayer neural networks. All deep learning is machine learning, all machine learning is AI, never the reverse.

Training and inference

Learned systems live in two phases. Training is the slow, costly phase where the model studies examples and adjusts itself to reduce mistakes; it happens occasionally. Inference is the fast, cheap phase where the finished model is put to work on something new. Training is the education; inference is the working life.

Concept 3 of 10

Worked example

Suppose you want software to tell cats from dogs in photos. Rule-writing fails fast: you would have to describe whiskers, ears, and fur in code that survives every angle and breed. The learning approach skips the description — you gather thousands of labelled photos, let the model learn the patterns separating the two, then run inference on pictures it never saw. You never wrote a definition of "cat"; the examples supplied it.

Concept 4 of 10

Counterexample

Not everything should be learned. Computing sales tax is a fixed percentage set by law — arithmetic that is always right. Training a model on past receipts to "predict" it would be slower, opaque, and occasionally wrong. Machine learning earns its place only where the rules are unknown, too numerous, or too tangled to write by hand.

Concept 5 of 10

Case study: email spam filtering

Early spam filters, in the late 1990s, were hand-written keyword rules: block any message containing certain words. Spammers simply changed the words — misspelling them, spacing them out — and every change forced a human to write a new rule, an arms race unwinnable by hand. The turning point was the learned classifier, popularised by Paul Graham's 2002 essay "A Plan for Spam", which used a Bayesian approach: rather than coding rules, the filter learned from each user's own labelled mail which patterns predicted spam. Large services such as Gmail later scaled this into full machine learning, and Google has reported blocking the large majority of spam automatically. The filter adapts because it keeps learning from new examples.

Concept 6 of 10

Common misconceptions

  • "Machine learning and AI are the same thing." — Machine learning is one branch of AI; much of AI does no learning at all.
  • "The machine understands what it is doing." — It detects statistical patterns; recognising a cat in pixels is not knowing what a cat is.
  • "More rules make a better learner." — Learned systems replace hand-written rules with patterns found in data; piling on rules is the old approach.
  • "Once trained, a model keeps improving on its own." — A deployed model is frozen until someone retrains it; inference teaches it nothing new.
Concept 7 of 10

Interactive challenge — Rule or Learn?

You are shown a series of tasks — computing a refund, flagging offensive comments, sorting mail, calculating shipping — and decide which suit hand-written rules and which call for machine learning, defending each choice.

Think Like a Maester: A rule-based program can be read to know what it will do. A learned model can only be watched to find out. That is why the first question about any machine learning system is not "how clever is it" but "how was it tested".

Concept 8 of 10

Knowledge check

  1. In your own words, how does machine learning differ from traditional rule-based programming?
  2. How do AI, machine learning, and deep learning relate to one another?
  3. What happens during training, and what happens during inference?
  4. Give an example of a task better solved with a fixed rule than with machine learning, and say why.
  5. Why did learned spam filters outlast hand-written keyword rules?
Concept 9 of 10

Lesson summary

Machine learning is the branch of AI in which systems learn patterns from examples instead of hand-written rules. It nests inside AI and itself contains deep learning. A model is educated once in training and used many times in inference, and because its behaviour is learned rather than written, it must be judged by testing, not reading. Spam filtering — from brittle keyword lists to adaptive classifiers — shows why the shift took hold wherever rules grew too many and too changeable to maintain.

Quick check

What most clearly distinguishes machine learning from traditional rule-based programming?