Simple theory: Machine learning is a way to make software learn patterns from examples instead of writing every rule by hand. You give it data, it learns a model, and that model tries to make useful predictions on new data.
Traditional programming is you writing rules: IF temperature > 100 THEN flag as hot. Machine learning flips this: you show the computer thousands of examples and it figures out the rules itself. You don't program the answer — you program the learning process.
Three types of machine learning
Supervised learning: you provide labelled examples (input → correct output). The model learns the mapping. Used for classification (spam/not-spam) and regression (house price). Unsupervised learning: data has no labels. The model finds structure itself — clusters, patterns, compressed representations. Reinforcement learning: an agent takes actions, receives rewards or penalties, and learns a strategy to maximise total reward.
Traditional programming vs machine learning
- Traditional: Developer writes rules → Program + Input → Output
- Machine Learning: Data + Output (labels) → Algorithm learns → Rules (model)
- Traditional is brittle — new edge cases need new hand-written rules
- ML generalises — it abstracts patterns that handle unseen cases automatically
- Both have their place: ML wins when rules are too complex or numerous to write by hand
Where machine learning lives
Every recommendation you see (Netflix, Spotify, Amazon), every spam filter, every voice assistant, every image search, every fraud detection system — all ML. The algorithm changes, but the core idea is always the same: learn patterns from data, generalise to new inputs.