Learnai-foundationsRule-Based vs. Learning Systems

Lesson · 7 min

Rule-Based vs. Learning Systems

Two ways to build a smart machine — and when each wins.

There are two classic ways to make a computer seem smart. Rule-based systems follow instructions a human wrote: "IF the email contains 'free money' THEN mark as spam." Machine learning systems figure out the rules from examples.

Head to head

  • Rule-based: predictable, explainable, brittle. Great for taxes and traffic lights.
  • Machine learning: flexible, handles messy input, but can be wrong in surprising ways and hard to explain.
  • Hybrid: real systems mix both — a spam filter may learn patterns AND obey hard rules like blocklists.
Why not always learn from data? Because data can be scarce, biased, or expensive, and sometimes the rules are simply known. You don’t need ML to compute your GPA.

Try it yourself

Try it — match

Match each system to the property that best describes it.

Click a card, then a slot (or a slot, then a card). Click again to detach.

Knowledge check

1

A thermostat turns the heater on below 20°C. What kind of system is it?

2

Which task would benefit MOST from machine learning over hand-written rules?

3

What is a weakness of rule-based systems?