What is the difference between Class and Label ? – Everything you need to know now

In this article we will see an efficient mnemonic to always remember what is a class and a label in classification.

In Machine Learning there are different types of approaches to solve a problem.

Among them, classification problems form a large part of the spectrum.

Unfortunately, some classification concepts are confused or misunderstood by some people.

Let’s see now how to remember these different concepts :

  • Class and Label
  • Binary classification
  • Multi-class – multi-label classification

What is a class?

Let’s take an example.

We need to predict the weather in Paris for all days of the week.


Here we only want to predict how the weather will be.

For this example, we have three options: sunny, rainy, snowy.

Each day must be classified in each of these options.

Therefore it’s a classification problem.

Note that if we were to predict the temperature in °C or °F, it would no longer be a classification problem but a regression problem.

These three options (sunny, rainy, snowy) are in fact our classes.

They are the three in which we have to classify our data (the days of the week).

Classified data

Mnemonic : A class is a category in which to classify our data.

A binary classification is a classification with only two classes.

A multi-class classification is a classification with more than two classes.

What is a label?

Let’s continue our example.

Now we don’t just have to predict the weather for Paris but also for Miami and Moscow.

Labeled data

Here we always want to predict how the weather will be.

BUT for the same day, we have 3 different locations. And therefore 3 possible results.

These cities are in fact our labels.

These labels allow us to differentiate our days of the week according to the city.

The classification problem is still the same but we’ll have to repeat the operation for each label.

Labeled and classified data

Mnemonic : A label is a category that allows us to differentiate (label) our data.

A multi-class multi-label classification is a classification with more than two classes and more than one label.

Note that different labels for data do not necessarily imply the same classes.

We can imagine that in New York we have 3 classes (sunny, rainy, snowy) while in London only 2 (rainy, cloudy).

Class, label and then?

In Deep Learning, you have to adapt your neural network to each of these types of classification.

Indeed, for a binary classification problem, the output layer will not be the same as in a multiclass classification problem.

An output layer implies a different activation function !

In this article, we present the type of activation function to use in each classification. A table is waiting for you at the end of the article with the summary of this knowledge.

source :

Tom Keldenich
Tom Keldenich

Data Engineer & passionate about Artificial Intelligence !

Founder of the website Inside Machine Learning

Leave a Reply

Your email address will not be published.

Beginner, expert or just curious?Discover our latest news and articles on Machine Learning

Explore Machine Learning, browse our most recent notebooks and stay up to date with the latest practices and technologies!