Classification Problems
A class is a category in a classification problem.
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.
A label is not a general description of all categories. It is the class associated with one specific sample.
Three Terms to Separate
| Term | Meaning | Role in a classification problem |
|---|---|---|
| Sample | An individual data point | The particular item being considered |
| Class | A category | A category used in the classification problem |
| Label | The class associated with a specific sample | The 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.
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.
- 1S1
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.
- 2S2
S2 is another individual data point, so S2 is a sample. Its associated class is Class B, making Class B the label for S2.
- 3S3
S3 is also a sample. It is associated with Class A, so Class A is the label for S3 as well.
- 4Compare 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.
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.
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
Common mistake Calling the sample a class
What it looks likeTreating S1 as a category rather than as an individual data point.
Why it failsA sample is an individual data point. A class is a category.
Do this insteadDescribe S1 as a sample and the category associated with S1 as its class or label.
Common mistake Calling the full collection of categories one sample's label
What it looks likeSaying that the label for S1 is Class A and Class B together.
Why it failsA label is the class associated with one specific sample.
Do this insteadIf S1 is associated with Class A, say that Class A is the label for S1.
Common mistake Assuming a class can label only one sample
What it looks likeSaying that Class A cannot be the label for S3 because it already labels S1.
Why it failsThe same class can serve as the label for multiple samples.
Do this insteadAllow multiple samples to have the same class as their label, as S1 and S3 both have Class A in the example.
Check Your Understanding
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.
- 1Identify the sample
S4 is the individual data point, so S4 is the sample.
- 2Identify the class
Class B is a category in the classification problem, so Class B is the class associated with S4.
- 3Identify 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
- 1A sample is an individual data point.
- 2A class is a category in a classification problem.
- 3A label is the class associated with one specific sample.
- 4The collection of possible classes is different from the single class assigned as a sample's label.
- 5The same class can be the label for multiple samples.
At a glance
- 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.