Intermediate

Machine learning: supervised and unsupervised learning

Machine learning is at the heart of most AI systems. Rather than writing every rule by hand, you give examples to an algorithm, which works out a model on its own that can handle new cases. Two main approaches dominate: supervised learning and unsupervised learning. Understanding the difference helps you know what to expect from your data.

How machine learning works

A machine learning project generally follows the same steps:

  1. Collect data that is representative of the problem.
  2. Prepare the data: clean it, fill in gaps, standardize formats.
  3. Train a model: the algorithm adjusts its parameters to best reproduce the patterns in the data.
  4. Evaluate the model on data it has never seen.
  5. Put it into production and monitor its performance over time.

Key takeaway: data quality often matters more than the choice of algorithm. Inconsistent data produces an inconsistent model.

Supervised learning

In supervised learning, each training example comes with the right answer, called a label. The model learns to associate an input with that answer.

There are two types of tasks:

  • Classification: predicting a category. For example, determining whether a message is a quote request, a complaint or a simple question.
  • Regression: predicting a numerical value. For example, estimating a processing time or a volume of requests.

Practical example: a business has several hundred customer messages already categorized by its team ("quote," "after-sales," "information," "other"). These labeled messages can be used to train a model that will automatically suggest a category for each new message, which the team can correct if needed.

The main cost of supervised learning is labeling: qualified people need to have annotated enough examples, consistently.

Unsupervised learning

In unsupervised learning, the data has no labels. The model looks for hidden structures on its own.

The most common uses:

  • Clustering: forming groups of similar customers, products or messages.
  • Anomaly detection: spotting what is out of the ordinary, such as an unusual order.
  • Dimensionality reduction: simplifying complex data to make it easier to visualize or use.

The advantage is being able to explore raw data without any prior annotation work. The trade-off: the groups found have no automatic meaning, and it is up to a human to interpret them.

Comparing the two approaches

Criterion Supervised Unsupervised
Data Labeled (with the right answer) Unlabeled
Goal Predict a category or a value Discover structures
Evaluation Fairly simple: compare against the right answer More subjective, requires interpretation
Example Classifying an inbound message Grouping customers with similar behavior
Main effort Labeling the data Interpreting the results

What about other approaches?

There are other families, notably semi-supervised learning (a little labeled data, a lot of raw data) and reinforcement learning, where a system learns by trial and error through rewards. Large language models actually combine several of these techniques during their training.

What it takes to succeed

Before launching a machine learning project, a few conditions are worth checking:

  • A measurable goal: "better sorting of requests" is too vague; "automatically suggesting a category for each inbound message" is actionable.
  • Available and accessible data, ideally already centralized in a CRM or a database.
  • A sufficient volume that is representative of real situations, including rare cases.
  • A correction loop: errors spotted by the team are used to improve the model.
  • Long-term monitoring: behaviors change, and a model that performs well today can degrade.

Do you always need to train your own model?

Not necessarily. For many language-related tasks, an already-trained large language model, well guided by instructions and a few examples, gives satisfactory results without specific training. Training a dedicated model is more justified when volumes are large, the task is very specific, or cost and confidentiality constraints require it.

To learn more about neural networks, see the guide Deep learning and neural networks.

FAQ: your questions about this guide

Which approach should I choose to sort customer messages?
If you have messages that are already categorized, supervised learning is a good fit. Otherwise, an LLM guided by clear instructions can often suggest a category without any prior training.
How much data do you need to train a model?
There is no universal figure: it depends on the complexity of the task, the number of categories and the quality of the data. A test on a sample quickly shows whether the volume is sufficient.
Is machine learning only for data scientists?
Designing a custom model requires specific skills, but many tools and services today make it possible to use machine learning without building everything yourself.

Have other questions?

Explore our guides or contact us directly.