Practical guide

What is machine learning? Learning from examples, explained simply

Machine learning is the part of artificial intelligence in which software learns from examples instead of following rules written by hand. Here is how it works, the main types, why the data matters so much, where you already meet it at work and what it cannot do.

Updated · 8 min read · NotHuman

Key points

  • Machine learning is a way of building software that learns patterns from examples instead of following rules a programmer writes by hand.
  • Supervised learning learns from examples with known answers, unsupervised learning looks for structure in data without answers, and reinforcement learning learns by trial, reward and penalty.
  • Deep learning is a branch of machine learning that uses large neural networks; it powers speech recognition, image recognition and today’s chatbots.
  • A machine learning model is only as good as its training data: gaps, errors and bias in the data reappear in its results.
  • Generative AI, such as ChatGPT, is a form of machine learning that creates new text, images or sound instead of only sorting or predicting.

Your email inbox moves most spam out of sight before you see it. Your bank sometimes blocks a card payment that does not look like you. Your phone turns your voice into text. None of these systems was programmed with a complete list of rules. They learned from examples. That is machine learning.

This guide explains the idea in plain words: how learning from examples differs from classic software, the three main types, what deep learning and neural networks are, why the data matters so much, where small and medium-sized businesses already use it, and what it cannot do.

Machine learning in one sentence

Machine learning is a way of building software that learns patterns from examples, then uses those patterns to make predictions or decisions about new cases.

Google’s introductory course describes it as training a piece of software, called a model, to make useful predictions or generate content from data. IBM puts it the same way: the model finds regularities in example data and applies them to inputs it has never seen.

Rules versus examples

Classic software follows rules that a person writes. To sort email, a programmer might write: “if the subject contains ‘free money’, move it to spam”. This works until spammers change their wording, and then someone has to write a new rule.

Machine learning turns this around:

  • Classic software: a person writes the rules, the computer applies them to data.
  • Machine learning: a person supplies examples (thousands of emails marked “spam” or “not spam”), and the computer works out the rules itself.

The result is a model: a large set of numbers that captures what the examples have in common. When a new email arrives, the model gives its best guess, often with a level of confidence, such as “92% likely to be spam”.

Training and use

There are two phases:

  1. Training. The model is shown many examples and adjusts its internal settings until its answers match the examples as closely as possible. This can take minutes for a small model or months on thousands of computers for the largest ones.
  2. Use (sometimes called inference). The trained model is applied to new cases. This is the part you see in everyday tools.

A model does not keep learning on its own once it is in use, unless someone retrains it with new data.

The three main types of machine learning

Supervised learning: learning with the answers

The model learns from examples where the correct answer is known. Each email is marked “spam” or “not spam”; each past invoice is marked “paid on time” or “paid late”. The model learns to link the input to the answer.

Supervised learning is used for two kinds of task:

  • Classification: putting things into categories (spam or not, fraud or not, invoice or delivery note).
  • Regression: predicting a number (how many croissants will sell on Saturday, how long a repair will take).

Most machine learning in business today is supervised.

Unsupervised learning: finding structure without answers

Here the data has no labels. The model looks for patterns by itself, such as groups of similar items. A shop might use it to discover that its customers fall into a few natural groups by what they buy and when, without deciding those groups in advance. It is also used to spot unusual cases that do not fit any group, which is one way to flag possible errors or fraud.

Reinforcement learning: learning by trial and reward

The system acts, sees the result and receives a reward or a penalty. Over many attempts, it learns which actions lead to the best outcome. This is how programs learned to play Go and chess at a very high level, and how robots learn to walk. It is also used, together with human feedback, to make chatbots give more helpful and polite answers.

Reinforcement learning is rarely something an SME builds itself, but it shapes many of the tools you use.

Deep learning and neural networks

A neural network is a type of model loosely inspired by the brain. It is made of many simple units arranged in layers. Each unit takes in numbers, weights them and passes a result to the next layer. During training, those weights are adjusted millions or billions of times until the network gives good answers.

Deep learning simply means neural networks with many layers. More layers let the model pick up more complex patterns: the edges in an image, then shapes, then whole objects; or letters, then words, then meaning.

Deep learning is behind most of the progress of the last fifteen years: speech recognition, translation, image recognition, reading scanned documents and today’s chatbots. Its drawbacks are that it needs large amounts of data and computing power, and that its reasoning is hard to inspect. IBM notes that the largest models are much harder to interpret than simpler methods such as decision trees.

Why training data matters so much

A model learns only from what it is shown. That makes the data the most important ingredient, more than the algorithm.

Quality

Errors in the data become errors in the model. If half the “late payment” labels are wrong, the model learns the wrong lesson. If the sales history includes a month when the till system was broken, the forecast will be off. Cleaning and checking data usually takes more time than training the model.

Coverage

A model can only handle situations similar to those in its examples. A demand forecast trained on three normal years will not anticipate a pandemic. A document reader trained on German invoices may struggle with Italian ones.

Bias

If the examples reflect an unfair or unbalanced past, the model will repeat it. A model trained on past hiring decisions may learn to favour profiles that were favoured before, even if nobody intended it. The US standards body NIST points out that bias does not come only from the data: it also comes from how a system is designed, tested and used, and from the people involved. It recommends managing bias at every stage, from the first idea to everyday use.

For an SME, the practical lesson is simple: before trusting a model, ask what data it learned from, whether that data looks like your situation, and who checks the results.

Examples you already meet at work

Many of these run inside software you already use, so you may not think of them as AI:

  • Spam and phishing filters. Trained on huge volumes of email to recognise unwanted or dangerous messages.
  • Fraud detection. Card providers analyse patterns in transactions and block payments that look unusual. The Swiss data protection commissioner (FDPIC) cites this as a typical example of AI in everyday life.
  • Demand forecasts. A bakery, a garden centre or a wholesaler can predict sales from past figures, the day of the week, holidays and the weather, and adjust orders and staffing.
  • Document reading. Software reads scanned invoices, receipts or delivery notes and extracts the date, amount, VAT and supplier. This combines image recognition with language models.
  • Speech-to-text. Dictating a site report or transcribing a meeting.
  • Translation. Machine translation between French, German, Italian and English is deep learning.
  • Recommendations. Online shops suggesting “customers also bought”.
  • Predictive maintenance. Sensors on machines, combined with a model, warn that a part is likely to fail soon.

How machine learning relates to generative AI

The terms are nested, a bit like Russian dolls:

  • Artificial intelligence is the broad field. The OECD, whose definition many laws follow, describes an AI system as one that infers from its inputs how to produce outputs such as predictions, content, recommendations or decisions.
  • Machine learning is the main way of building AI today: learning from examples.
  • Deep learning is machine learning with large neural networks.
  • Generative AI is a use of deep learning that creates new content (text, images, sound, code) rather than only sorting or predicting.
  • Large language models, such as those behind ChatGPT, Claude or Gemini, are generative models trained on very large amounts of text. Read more in our guides to generative AI and large language models.

The difference in practice: a classic machine learning model answers a narrow question (“is this spam?”, “how many units next week?”) and is often trained on your own data. A generative model is general-purpose, trained by a large provider on public data, and produces open-ended answers, which also makes it able to invent things that sound right but are wrong. Our guide to AI hallucinations explains why.

The limits of machine learning

  • It finds correlations, not causes. A model may notice that ice-cream sales and sunburn rise together without knowing that the sun drives both.
  • It struggles with the new. When conditions change (a new product, a new law, a crisis), past examples may no longer apply. Models need monitoring and retraining.
  • It is never 100% right. Every model makes mistakes. The question is how often, which kind, and what they cost. A spam filter that lets one spam through is a nuisance; one that hides an important client email is worse.
  • It can be hard to explain. Large models rarely give a reason a person can check. That matters when a decision affects someone.
  • It depends on data you are allowed to use. Training or using a model on personal data falls under the Swiss Federal Act on Data Protection, as for any other processing. See our guide to Swiss AI law.

What this means for an SME

You do not need to build models to benefit from machine learning: most of it arrives inside tools you already pay for. When you consider a new AI feature, a few questions help:

  1. What exactly does it predict or decide?
  2. What data was it trained on, and does it resemble yours?
  3. How often is it wrong, and what happens when it is?
  4. Who checks the results before they affect a client, an employee or a payment?
  5. Where is your data processed?

If you want to go further, start with our plain-language guide to what AI is, then learn how to write a good prompt for the generative tools your team already uses.

Frequently asked questions

Is machine learning the same as artificial intelligence?

No. Artificial intelligence is the broad field of systems that produce predictions, content, recommendations or decisions from data. Machine learning is the main method used today to build such systems, but not the only one: the field also includes older approaches, such as expert systems built from hand-written rules.

Do I need my own data to use machine learning?

Not always. Many tools come with models already trained by the provider, such as spam filters, translation or document reading. You need your own data when you want a model to learn something specific to your business, such as your sales patterns or your types of documents.

How much data does machine learning need?

It depends on the task. A simple forecast can work with a few years of clean sales figures, while recognising images or language from scratch takes millions of examples. In both cases, a smaller set of correct, representative data beats a large set of messy data.

Can a machine learning model explain its decisions?

Simple models, such as decision trees, are fairly easy to read. Large neural networks are much harder to interpret: they give a result without a clear human-readable reason. For decisions that affect people, keep a person who can check and explain the outcome.

Is ChatGPT machine learning?

Yes. ChatGPT runs on a large language model, which is a deep learning model trained on very large amounts of text to predict the next word. It is a form of generative AI, which is itself a branch of machine learning.

This guide gives general information and is not legal advice. Check providers’ current terms and, if in doubt, ask a specialist.

NotHuman

Need help putting this into practice?

In a free 30-minute audit, we look at your situation and suggest concrete next steps.

Contact

A question? A project?

A real person reads every message. No commitment.

We only use this information to reply to you. See our privacy policy.

A personal reply, usually within 2 working days.