
The spam filter in your email, the series recommended to you, credit-card fraud alerts… The rules of these systems weren't written one by one; they learned from examples. This is called machine learning (ML) and it is the most common route to AI. In this guide you learn what machine learning is, how it works, its main types, how a model is trained and the common traps.
What is machine learning?
In traditional programming a person writes the rules and the computer applies them. In machine learning a person gives examples and the computer learns the rules (the model) itself.
Example: solving "is this email spam?" with rules is hard (which words? which patterns?). In machine learning you show the model hundreds of thousands of spam and normal emails; the model learns for itself which features point to spam (see our what is AI guide).
Basic concepts
| Concept | Meaning |
|---|---|
| Dataset | The examples used in training |
| Feature | An input used for prediction (such as word count, amount) |
| Label | The right answer (such as "spam"/"normal") |
| Model | A mathematical representation of learned patterns |
| Training | The process of the model learning from data |
| Test | Measuring the model's success on new data |
| Prediction | The trained model's output for a new input |
Types of machine learning
1. Supervised learning
The data is labelled. The model learns the relationship between the input and the correct output.
- Classification: predicting a category (spam/not, ill/healthy, which product category).
- Regression: a numeric prediction (house price, sales quantity).
Examples: predicting loan approval, recognising objects in images, sales forecasting (see our Excel forecast and trend guide).
2. Unsupervised learning
The data is unlabelled. The model discovers the structure itself.
- Clustering: grouping similar customers.
- Dimensionality reduction: simplifying data.
- Anomaly detection: finding unusual transactions.
3. Reinforcement learning
An agent takes actions in an environment, receives rewards or penalties and over time learns the best strategy. It is used in game-playing systems, robotics and some control problems.
4. Deep learning
Learning done with multi-layer artificial neural networks; very successful in images, sound and language. Chatbots and image generators rest on it (see our generative AI guide).
- 1
Define the problem and the success measure
- 2
Collect and clean data
- 3
Prepare the features
- 4
Split the data into training and test
- 5
Train and evaluate the model
- 6
Put it into use, monitor and update
Training and test data
To tell whether the model really learned you split the data:
- Training set (e.g. 70–80%): the examples the model learns from.
- Validation/test set (20–30%): examples the model hasn't seen before.
If the model is good on the test too, it can generalise. A model that succeeds only on the training data is useless.
Overfitting and underfitting
| Situation | Sign | Cause | Fix |
|---|---|---|---|
| Overfitting | Very good in training, bad in test | The model memorised the data | More data, simplification, regularisation |
| Underfitting | Bad everywhere | The model is too simple or data insufficient | A stronger model, better features |
Data quality: the most critical point
"Garbage in, garbage out." Data problems:
- Missing and wrong data: must be cleaned (see our Excel data cleaning guide).
- Biased data: data that under-represents some groups can make the model unfair.
- Label errors.
- Leakage: using information in training that couldn't be known at prediction time.
- Data drift: the real world changes over time; the model can go stale.
When working with personal data learn the privacy and legal requirements.
How is success measured?
| Measure | What it shows |
|---|---|
| Accuracy | The share of correct predictions (can mislead on imbalanced data) |
| Precision / Recall | The balance of false alarms and misses |
| Mean error | In regression, the gap between prediction and reality |
Example: when detecting a very rare disease a model that says "everyone is healthy" can be 99% accurate but is useless. Choosing the right measure matters.
Everyday examples
- Email: spam/important classification.
- Shopping: product recommendations, price prediction.
- Banking: fraud detection, credit risk.
- Health: support in image analysis.
- Transport: demand and duration prediction.
- Business: churn prediction, stock forecasting (see our CRM guide).
- Phone: face recognition, keyboard suggestions.
A roadmap to start
- Learn the concepts: data, feature, model, training, test.
- Basic data skills: Excel/spreadsheets, data cleaning, reading charts (see our Excel guides).
- Python and basic libraries: data handling and ML libraries.
- Start with a small project: for example house price prediction or customer classification.
- Practise with ready datasets.
- Understand evaluation and errors.
- Try no-code tools too: some platforms let you train a model without code (see our no-code tools guide).
Common mistakes
- Jumping to the model without examining the data.
- Using test data in training.
- Looking only at accuracy.
- Choosing a complex model; a simple model is often enough.
- Ignoring bias.
- Training the model once and forgetting it.
- Mistaking correlation for causation: a model finds relationships, it doesn't prove cause and effect.
Frequently asked questions
Is maths a must for machine learning? Not for the basic concepts; statistics and linear algebra help to go deeper.
What is the difference between machine learning and deep learning? Deep learning is a sub-branch of machine learning done with multi-layer neural networks.
Is a lot of data needed? It depends on the problem; for simple problems little data can do, deep models want a lot.
Can machine learning be done in Excel? Simple predictions (trend, regression) can; advanced models need special tools.
Who is responsible if the model errs? The organisations and people using it; human oversight is essential in critical decisions.
Summary
Machine learning is the way to build systems that learn from examples and predict. It has supervised, unsupervised and reinforcement types; success depends largely on data quality and proper evaluation. Avoid overfitting, keep the test separate and start learning with a small project.
Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.