Recall & Review
beginner
What is label encoding in machine learning?
Label encoding is a technique that converts categorical text data into numbers so that machine learning models can understand and use it.
Click to reveal answer
beginner
Why do we need to use label encoding?
Because many machine learning models only work with numbers, label encoding changes categories like 'red', 'blue', 'green' into numbers like 0, 1, 2.
Click to reveal answer
beginner
How does label encoding assign numbers to categories?
It assigns a unique integer to each category, usually starting from 0 and increasing by 1 for each new category.
Click to reveal answer
intermediate
What is a potential problem with label encoding for some machine learning models?
Label encoding can make models think that one category is greater or less than another because of the numbers, which might not be true for categories without order.
Click to reveal answer
beginner
Give an example of label encoding for the categories: ['cat', 'dog', 'bird'].
An example encoding could be: 'cat' → 0, 'dog' → 1, 'bird' → 2. Each category gets a unique number.
Click to reveal answer
What does label encoding do to categorical data?
✗ Incorrect
Label encoding converts categories into numbers so models can process them.
Which of these is a possible label encoding for ['apple', 'banana', 'cherry']?
✗ Incorrect
Label encoding usually starts from 0 and assigns increasing integers to categories.
Why might label encoding cause problems for some models?
✗ Incorrect
Label encoding can make models think categories have order when they don't.
Which type of data is label encoding used for?
✗ Incorrect
Label encoding is used to convert categorical data into numbers.
What is the first number assigned in label encoding?
✗ Incorrect
Label encoding usually starts numbering categories from 0.
Explain what label encoding is and why it is important in machine learning.
Think about how models understand data.
You got /3 concepts.
Describe a situation where label encoding might cause problems and why.
Consider how numbers might mislead a model.
You got /3 concepts.