Concepts / Machine Learning Data Terminology

Machine Learning Data Terminology

The basic relationship is sample → label → class: a sample is the individual data point, and its label identifies the class associated with it.

  • Programming

Start with One Item

Classification terminology becomes easier when you begin with one data point instead of a whole dataset. Imagine one item being considered in a classification problem. That item is a sample. The category it belongs to is a class. The class associated with that particular sample is its label.

Key point

The basic relationship is sample → label → class: a sample is the individual data point, and its label identifies the class associated with it.

Trace One Sample

S1sampleLabelClass AClass Acategoryhasidentifies
How does one data point become associated with the category it belongs to?

In this relationship, S1 is the sample because it is one individual data point. Class A is a class because it is a category in the classification problem. Because Class A is associated with S1, Class A is the label for S1. The word label describes the association from the perspective of that particular sample.

Class Versus Label

Definition

A class is a category in a classification problem. A sample is an individual data point. A label is the class associated with a specific sample.

Class and label can refer to the same category name, but they answer different questions. Class asks, “What category exists in the classification problem?” Label asks, “Which class is associated with this particular sample?” Therefore, Class A can be a class in general, and it can also be the label for S1 when S1 is associated with Class A.

TermMeaningFocus
SampleAn individual data pointOne item being considered
ClassA category in a classification problemA category available in the problem
LabelThe class associated with a specific sampleThe category assigned to one item

The terms describe different parts of a classification relationship.

All Categories and One Assignment

Class Aone available categoryClass Alabel for S1Class Bone available category
What is the difference between all possible categories in a classification problem and the single category assigned to one sample?
Worked example

Following S1, S2, and S3

Suppose the classification categories are Class A and Class B. S1 is associated with Class A, S2 is associated with Class B, and S3 is associated with Class A.

  1. 1
    Step 1

    S1 is an individual data point, so S1 is a sample. Because S1 is associated with Class A, Class A is the label for S1.

  2. 2
    Step 2

    S2 is another sample. Because S2 is associated with Class B, Class B is the label for S2.

  3. 3
    Step 3

    S3 is also a sample. It may have Class A as its label, showing that the same class can be associated with more than one sample.

  4. 4
    Step 4

    Class A and Class B are the categories used in the classification problem. The label for an individual sample is one class associated with that specific sample.

Result

The available classes are Class A and Class B. The labels are Class A for S1, Class B for S2, and Class A for S3.

Key point

A classification problem can have multiple classes, while one specific sample has its own associated label. The same class can be the label for multiple samples.

Mistakes to Avoid

  • Common mistake

    Treating a sample as a category

    What it looks like

    Calling S1 a class because it appears in a classification problem

    Why it fails

    S1 is one individual data point, so it is a sample. A class is a category.

    Do this instead

    Describe S1 as a sample and identify the class associated with it as its label.

  • Common mistake

    Treating the whole collection of classes as one sample's label

    What it looks like

    Saying that both Class A and Class B are the label for S1

    Why it fails

    The label is the class associated with one specific sample, not the complete collection of categories.

    Do this instead

    For S1, name the one associated class. In the source example, Class A is the label for S1.

  • Common mistake

    Assuming a class can label only one sample

    What it looks like

    Saying that Class A cannot be the label for S3 because it already labels S1

    Why it fails

    The same class can be associated with more than one sample.

    Do this instead

    Allow multiple samples to have the same class as their label.

Check Your Understanding

EASY

A classification problem uses Class A and Class B. S1 is associated with Class B, while S2 and S3 are associated with Class A. Identify the samples, the classes, and the label for each sample.

Hints
  • A sample is an individual data point.
  • The classes are the categories used in the classification problem.
  • For each sample, its label is the class associated with that particular sample.

What do you think happens?

If S1 and S3 are both associated with Class A, can Class A be the label for both samples?

  • Yes

  • No

Reveal answer
Answer:

Yes

The same class can serve as the label for multiple samples.

Terminology Summary

  1. 1
    A sample is an individual data point.
  2. 2
    A class is a category in a classification problem.
  3. 3
    A label is the class associated with a specific sample.
  4. 4
    The collection of classes describes the categories used by the classification problem, while a label identifies the category associated with one sample.
  5. 5
    The same class can be the label for multiple samples.

At a glance

  • A sample is one individual data point.
  • A class is a category in a classification problem.
  • A label connects one specific sample to the class associated with it.
  • A classification problem may use several classes, but each sample is considered through its associated label.
  • One class can serve as the label for multiple samples.

More concepts starting with M