Every time Netflix recommends a show, your email filters spam, or your phone unlocks with your face β machine learning is at work. But what is it, really?
The Core Idea
Traditional programming works like this: a programmer writes rules, and the computer applies those rules to data to get an answer.
Machine learning flips this:
You give the computer data + answers, and it figures out the rules on its own.
Those learned rules (the βmodelβ) can then make predictions on new data itβs never seen.
Three Main Types
1. Supervised Learning
You provide labelled training examples. The algorithm learns to map inputs to outputs.
- Email spam filter: input = email text, output = spam/not spam
- Image recognition: input = photo, output = βcatβ / βdogβ / βcarβ
- Price prediction: input = house features, output = price in dollars
Algorithms: Linear regression, decision trees, neural networks, support vector machines.
2. Unsupervised Learning
No labels. The algorithm discovers structure in the data on its own.
- Customer segmentation: group shoppers by behavior without pre-defined groups
- Anomaly detection: find unusual patterns in server logs
- Topic modeling: discover themes across thousands of documents
Algorithms: K-means clustering, DBSCAN, autoencoders.
3. Reinforcement Learning
The algorithm learns by trial and error, receiving rewards or penalties for its actions.
- Game playing: AlphaGo learned to beat world champions by playing millions of games against itself
- Robot control: a robot learns to walk by trying movements and getting rewarded for not falling
- Trading: an agent learns to buy/sell assets to maximize returns
How Training Works
Using supervised learning as an example:
- Feed in training data β thousands of labelled examples
- Make predictions β the model guesses the output for each input
- Calculate error β compare predictions to the correct answers
- Adjust weights β tweak the model to reduce error
- Repeat β thousands of iterations until the error is acceptably low
This iterative adjustment is called gradient descent β the model follows the slope of the error βlandscapeβ downhill toward minimum error.
What a Neural Network Actually Is
A neural network is layers of mathematical functions (called neurons) arranged so that information flows from input β hidden layers β output.
Each connection has a weight β a number that gets tuned during training. A large model like GPT-4 has hundreds of billions of these weights.
Explore this visually with our interactive Neural Network and Machine Learning for Kids tools.
Common Misconceptions
| Myth | Reality |
|---|---|
| βAI understands languageβ | It predicts which token comes next based on patterns |
| βML always needs massive dataβ | Many useful models train on thousands, not billions, of examples |
| βBlack box = unusableβ | Many domains use interpretable models (decision trees, regression) |
| βML will replace programmersβ | It augments β engineers design, evaluate, and deploy models |
Getting Started
The best way to understand ML is to try it. Our Sorting Algorithms visualizer shows how computers process data systematically β a prerequisite intuition for ML. For the math foundations, check out Statistics Lab and Probability.
Machine learning isnβt magic β itβs pattern recognition at scale. The core math is linear algebra, calculus, and statistics. Build those foundations first.