Skip to main content
Machine Learning & Deep Learning

⏱ About 10 min10 XP

What Is a Label?

Imagine you are teaching your little brother how to tell cats from dogs. You point to a picture and say, 'That one is a cat.' Then you point to another and say, 'That one is a dog.' Each time you say the name — cat or dog — you are giving that picture a label. A label is the name we give an example so a machine knows what it is.

Labels Are Like Name Tags

Think about name tags at a birthday party. Each tag says who that person is. Without name tags, a stranger would not know anybody's name. Labels work the same way for a machine. When we show a machine a picture of a cat, we attach a label that says 'cat.' When we show it a picture of a dog, we attach a label that says 'dog.' Over time, the machine studies all those labeled examples and learns to tell cats from dogs on its own.

The Big Idea

A label is the name we give an example. Labels teach the machine what each thing is called.

Here is a story. A teacher has a jar of red and green candy-coated chocolates all mixed together. She wants to teach a helper robot to sort them by color. First she picks up a red one and says, 'Label: red.' She picks up a green one and says, 'Label: green.' She does this for twenty candies. Now the robot has twenty labeled examples. It has seen what 'red' looks like and what 'green' looks like. Those labels are its clues.

Flashcards — click each card to reveal the answer

Labels can describe all sorts of things. A label might say 'spam' or 'not spam' for email messages. It might say 'cat,' 'dog,' or 'bird' for photos. It might say 'happy' or 'sad' for sentences. Whatever the job, the label is always the answer to the question: what is this?

Labels Must Be Clear

A good label is specific and consistent. If you label some cats as 'cat' and others as 'kitty,' the machine gets confused. Always use the same word for the same group.

What is a label in machine learning?

You show a machine a picture of a banana and write 'fruit' next to it. What is 'fruit'?

Make Your Own Labels

  1. Find or draw five simple pictures — animals, foods, or toys work great.
  2. For each picture, write one word label on a sticky note and stick it to the picture.
  3. Now mix up the pictures and give them to a friend or family member.
  4. Can they group the pictures using just the labels you wrote?
  5. Talk about what made your labels helpful or confusing.