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.