What is machine learning? A simple guide with everyday examples

Machine learning is how most of today's AI is built. Instead of writing rules, you show a computer examples and let it find the pattern. Here is how it works, the main types, and where you already use it.

Two panels. On the left, labelled traditional programming, a person writes rules into a computer, data goes in, and answers come out. On the right, labelled machine learning, data and the right answers go into a computer, and rules (a learned model) come out, which can then answer new questions.
Fig. 1 — Traditional programming: people write the rules. Machine learning: the computer learns the rules from examples.

Try writing down rules for recognising your best friend’s face. Distance between the eyes? Shape of the nose? Hairstyle? You’d never finish, and the rules would break the moment they wore glasses or got a haircut. Yet you recognise them instantly, because you’ve seen them many times.

Machine learning gives computers that same ability: instead of following rules written by people, they learn patterns from examples. It’s the approach behind spam filters, photo search, recommendations, voice assistants and today’s large language models. This guide explains what machine learning is, how it works, the main types, and where it shows up in your day.

What is machine learning?

Machine learning (ML) is a way of building computer systems that learn patterns from data, so they can make predictions or decisions about new data without being given step-by-step rules for the task.

Machine learning is a part of artificial intelligence (AI). AI is the big goal of making computers do tasks that need human-like intelligence; machine learning is the most successful way of getting there today. (Our guide to what artificial intelligence is shows how the two fit together.)

The term is old. Arthur Samuel, a researcher at IBM, is credited with coining it in a 1959 paper about a program that learned to play checkers better over time.

Rules vs learning

The big shift is who writes the rules.

Traditional programming Machine learning
Input Data + rules written by people Data + the right answers (or just data)
Output Answers A model: rules learned from the examples
Good for Clear, fixed logic: tax formulas, sorting, billing Fuzzy patterns: faces, speech, spam, recommendations
When the world changes Someone rewrites the rules Retrain on new examples

A spam filter shows the difference. Hand-written rules (“block emails containing lottery winner”) are easy to dodge. A machine learning filter studies thousands of emails people already marked as spam or not spam, and learns many subtle signals at once. When spammers change tactics, it can be retrained on fresh examples. (See what an algorithm is in AI for more on this.)

How does machine learning work?

Most machine learning projects follow the same basic steps:

A loop of five steps: 1 collect data, 2 choose a model, 3 train: guess, measure the error, adjust, repeat, 4 test on unseen data, 5 use it on new data. An arrow from test back to train is labelled not good enough? Improve the data or model, retrain.
The machine learning loop. Most of the real work is in the data and the testing.
  1. Collect data. Gather examples that match the job, often with the right answers attached. (See datasets.)
  2. Choose a model. Pick the kind of model to learn with: a simple line, a decision tree, a neural network, and so on.
  3. Train it. The model makes guesses on the training examples, measures how wrong they are, and adjusts its internal numbers to be a little less wrong. This repeats thousands or millions of times.
  4. Test it. Check how well it does on examples it has never seen. A model that does well on its training examples but badly on new ones is overfitting (letter O).
  5. Use it. Put the trained model to work on new data. This is called inference (see inference).

The “learning” in step 3 is not magic, and the computer doesn’t understand like a person. It is maths: the model adjusts numbers so that its outputs match the examples better.

The main types of machine learning

Supervised learning

The model learns from examples that come with the right answers (labels). Photo + “cat”. Email + “spam”. House details + price. Then it predicts the answer for new examples. This is the most common type in business. (Letter S covers it in depth.)

Unsupervised learning

The model gets data without answers and finds structure on its own, such as grouping customers who behave alike, or spotting unusual transactions. (Letter U.)

Reinforcement learning

The model learns by trial and error, getting rewards for good actions and penalties for bad ones, like training a pet with treats. It’s used for game-playing programs, robotics, and parts of training chatbots to give answers people prefer.

Self-supervised learning

The data provides its own answers. Large language models learn this way: hide the next word in a sentence, predict it, check against the real word. No one has to label anything, which is why these models can learn from enormous amounts of text.

Machine learning, deep learning and AI

These words get used interchangeably, but they nest inside each other:

  • AI is the whole field.
  • Machine learning is AI that learns from data.
  • Deep learning is machine learning with large neural networks that have many layers (see what a neural network is).
  • Generative AI and large language models are built with deep learning (see generative AI).

Not all machine learning is deep learning. For many business problems with tables of numbers, such as predicting late payments, simpler methods like decision trees often work very well and are easier to explain.

Where you already use machine learning

  • Email: spam filtering and smart replies
  • Phones: face unlock, photo search (“show me beach photos”), keyboard suggestions
  • Shopping and streaming: “you might also like” recommendations
  • Maps: traffic predictions and arrival times
  • Banking: fraud alerts on unusual card payments
  • Voice assistants: turning speech into text
  • Chatbots: every large language model is a product of machine learning

What machine learning can’t do

  • It’s only as good as its data. Wrong, missing or unfair data produces wrong or unfair results. See AI bias.
  • It finds patterns, not causes. A model can notice that two things happen together without knowing why.
  • It can fail on situations unlike its training data. A model trained on daytime photos may struggle at night.
  • It isn’t always the right tool. If the rule is simple and fixed, like calculating tax, ordinary code is cheaper, faster and exact.

Common misconceptions

“Machine learning means the computer thinks for itself.” It adjusts numbers to fit patterns in data. It doesn’t have goals or understanding of its own.

“Machine learning and AI are the same thing.” Machine learning is the most common way to build AI today, but it’s one part of the field.

“ML models keep learning as you use them.” Most models are trained, then frozen and used. Updating them means training again.

“More data always fixes everything.” Better data usually beats more data. Bad examples teach bad lessons.

Key takeaways

  • Machine learning builds systems that learn patterns from data instead of following hand-written rules.
  • Arthur Samuel is credited with coining the term in 1959.
  • The basic loop: collect data, choose a model, train, test, use.
  • Main types: supervised, unsupervised, reinforcement and self-supervised learning.
  • Deep learning is machine learning with large neural networks; it powers today’s generative AI.
  • ML is powerful for fuzzy patterns, but it depends entirely on good data.

Frequently asked questions

What is machine learning in simple words?

Machine learning is teaching a computer by showing it examples instead of writing rules. It finds the patterns itself and uses them to handle new cases.

What is the difference between AI and machine learning?

AI is the broad goal of making computers do tasks that need human-like intelligence. Machine learning is one way to achieve it, by learning from data. Most modern AI uses machine learning.

What are the types of machine learning?

The main ones are supervised learning (examples with answers), unsupervised learning (finding structure without answers), reinforcement learning (trial and error with rewards), and self-supervised learning (where the data supplies its own answers, as with LLMs).

Do I need to know maths to learn machine learning?

To use ML tools and understand the ideas, no. To build and tune models yourself, basic statistics, algebra and some programming (often Python) help a lot.

Is ChatGPT machine learning?

Yes. ChatGPT runs on large language models, which are built with deep learning, a kind of machine learning.

Comments

LEAVE A COMMENT
No sign-up. Comments appear after a quick review.