From Rules to Learning: A Beginner’s Guide to How Machine Learning Really Works
Have you ever wondered how your email knows what’s spam and what’s not or how Netflix seems to know exactly what you’ll enjoy next?
That’s not magic, it’s machine learning.
In this article, we’ll strip away the technical fog and walk through what machine learning really means, how it differs from traditional programming, and how computers actually “learn” from data all explained in plain, human language.
From Rules to Learning (The Old vs. New Way)
Before machine learning, programmers relied on rule-based systems a world of if-else statements.
Let’s imagine you’re building a spam filter. You might start with rules like:
At first, it works fine. But soon, spammers change tactics. They use new words, different domains, and clever tricks. You keep adding more rules until the system becomes messy, fragile, and impossible to maintain.
That’s the hamster wheel of rule-based systems. You’re stuck chasing data instead of learning from it.
How Does Machine Learning Really Work?
“Ever wondered how machines actually learn patterns without being told what to do?”
Instead of defining endless rules, machine learning lets the computer learn patterns from data itself.
Here’s the new approach:
With enough examples, the machine starts recognizing spam better than your old rule-based code ever could.
How Machines Learn (Training vs. Using a Model)
To understand machine learning better, we have to distinguish between three important terms feature, target and model.
Features are the clues. They are the individual bits of information we know about something. For a car, the features could be its brand, color, engine size, and mileage.
The target is the answer. It's the specific thing we want to predict or find out. For example, if we want to predict a car's price, the price is our target. In training, we use data where the answer (the target) is already known.
A model is the recipe. It's a program that learns from the clues and answers in your training data to find a hidden pattern. Once trained, you can give the model the clues for a new object (a new car's features) and it will use its recipe to predict the answer (its price).
Think of machine learning as a two-step process: training and using.
Training a Model:
When you train a model, you feed it examples that contain both features (inputs) and targets (correct answers).
In our spam filter example:
The model studies thousands of these examples to discover the relationship between the features and the target. You can think of this as teaching a student: “Here are the questions and their correct answers now learn the pattern.”
After training, you now have a model a mathematical representation of all those learned patterns.
Recommended by LinkedIn
Using a Model:
When a new email arrives, the model looks at its features and predicts a probability say, 0.9 (very likely spam) or 0.2 (probably not spam). We then set a threshold for example, 0.5 to decide whether to mark it as spam.
That’s the essence of using a trained machine learning model.
Types of Machine Learning
Machine Learning comes in different flavors depending on how the computer learns from data.
At a high level, there are three main types you’ll often encounter:
Now that we’ve met the main types of ML, let’s take a closer look at the one you’ll encounter most often, Supervised Learning.
What is Supervised Machine Learning?
Machine learning has many flavors, but one of the most common and beginner-friendly is Supervised Learning.
“Supervised” means we act as teachers showing the model both the examples and the correct answers during training.
In simple terms:
Supervised learning is about finding a function that maps input data (X) to output labels (y).
Formally, the model tries to find a function g such that g(X) ≈ y.
Of course, it won’t be perfect but the goal is to be as close as possible.
Types of Supervised Learning
At its heart, machine learning is about discovering patterns in data so that computers can make predictions not by following hard-coded rules, but by learning from experience.
When we move from writing rules to teaching machines, we create systems that can adapt, scale, and even surprise us.
That’s the beauty of ML. It’s not about replacing humans, but about learning how to teach computers to think a little more like us.
Note: If you remember one thing from this article, let it be this;
“Machine learning doesn’t mean programming every decision it means programming the ability to learn.”
Further Reading & References