Concepts / Classification Problems

Classification Problems

A class is a category in a classification problem.

  • Programming

Start with One Data Point

Classification terminology becomes easier when you begin with one data point instead of an entire 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.

has labelS1sampleClass Alabel
How does a label connect one specific data point to the category it belongs to?

A label is not a general description of all categories. It is the class associated with one specific sample.

Three Terms to Separate

TermMeaningRole in a classification problem
SampleAn individual data pointThe particular item being considered
ClassA categoryA category used in the classification problem
LabelThe class associated with a specific sampleThe connection between one sample and its category

The three terms describe different parts of the same classification relationship.

The distinction is based on what each term refers to. A sample refers to an individual data point. A class refers to a category. A label refers to the category assigned to a particular sample. Therefore, the same class can be a label for more than one sample.

labellabellabelS1sampleClass AcategoryS2sampleClass BcategoryS3sample
How do multiple individual data points relate to the categories used to group them?

Trace the Assignments

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 also associated with Class A.

S1: 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.

S2: S2 is another individual data point, so S2 is a sample. Its associated class is Class B, making Class B the label for S2.

S3: S3 is also a sample. It is associated with Class A, so Class A is the label for S3 as well.

Compare the labels: Class A is the label for both S1 and S3. This shows that the same class can serve as the label for multiple samples.

S1 has label Class A, S2 has label Class B, and S3 has label Class A.

has labelClass A and Class Bpossible classesS1sampleClass Alabel for S1
What is the difference between the full collection of possible categories and the single category assigned to one sample?

Follow the Classification Relationship

A classification problem can be understood by following the relationship from an individual sample to the category associated with it. Start with the sample, identify the class connected to that sample, and use that associated class as the sample's label. The label describes the class connection for that particular sample.

considerbecomesSampleindividual data pointAssociated classcategoryLabelclass for that sample
How does a classification problem connect each sample to an associated category?

The relationship is specific to a sample: first identify the sample, then identify its associated class, and finally describe that associated class as the sample's label.

Mistakes Beginners Make

  • Calling the sample a class

    A sample is an individual data point. A class is a category.

    Fix: Describe S1 as a sample and the category associated with S1 as its class or label.

  • Calling the full collection of categories one sample's label

    A label is the class associated with one specific sample.

    Fix: If S1 is associated with Class A, say that Class A is the label for S1.

  • Assuming a class can label only one sample

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

    Fix: Allow multiple samples to have the same class as their label, as S1 and S3 both have Class A in the example.

Check Your Understanding

EASY

A classification problem uses Class A and Class B. S4 is an individual data point associated with Class B. Identify the sample, the class, and the label for S4.

Hints
  • An individual data point is a sample.
  • The category associated with the sample is its label.
  • The class and the label have the same category name for this particular sample.

Practice Answer

A classification problem uses Class A and Class B. S4 is an individual data point associated with Class B.

Identify the sample: S4 is the individual data point, so S4 is the sample.

Identify the class: Class B is a category in the classification problem, so Class B is the class associated with S4.

Identify the label: Because Class B is associated with S4, Class B is the label for S4.

The sample is S4, the class is Class B, and the label for S4 is Class B.

Key Takeaways

  1. A sample is an individual data point.
  2. A class is a category in a classification problem.
  3. A label is the class associated with one specific sample.
  4. The collection of possible classes is different from the single class assigned as a sample's label.
  5. The same class can be the label for multiple samples.

Key Takeaways

  • A sample is an individual data point.
  • A class is a category used in a classification problem.
  • A label connects one specific sample to its associated class.
  • The full collection of categories is not the same as the label for one sample.
  • One class can serve as the label for multiple samples.