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:

  1. Feed in training data β€” thousands of labelled examples
  2. Make predictions β€” the model guesses the output for each input
  3. Calculate error β€” compare predictions to the correct answers
  4. Adjust weights β€” tweak the model to reduce error
  5. 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

MythReality
”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.