A data scientist is analyzing a data set with categorical features and would like to make those features more useful when building a model. Which of the following data transformation techniques should the data scientist use? (Choose two.)
Suggested Answer: B
Get Premium DY0-001 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
One-hot encoding creates binary indicator columns for each category, allowing models to treat nominal categories without implying any order.
Label encoding maps categories to integer labels, which can be useful for tree-based models or when you need a single numeric column (though you must ensure the algorithm can handle treated ordinality appropriately).
37 comments · newest first
RO
Rolande
11 months ago
Pivoting could help in some cases, but not a primary method here.
VA
Valentin
11 months ago
Wait, is linearization even a thing for categorical data? Sounds off.
TO
Tony
11 months ago
One-hot encoding is definitely a go-to for categorical features!
TI
Tish
12 months ago
I think label encoding can be useful too, especially for ordinal data.
TA
Tamesha
12 months ago
Normalization? Not really needed for categorical features.
AR
Ardella
1 year ago
I vaguely recall something about pivoting, but I don't think that's what we need here. One-hot encoding definitely sounds right!
DE
Deeanna
1 year ago
I feel like normalization and scaling are more for numerical data, so I’m leaning towards one-hot and label encoding.
GR
Gracia
1 year ago
I'm not entirely sure, but I think label encoding might also be useful. It can convert categories to numbers, right?
AR
Arlette
1 year ago
I remember we talked about one-hot encoding in class; it seems like a good choice for categorical features.
DU
Dudley
1 year ago
One-hot encoding is definitely one of the techniques I would use. For the other, I'm torn between label encoding and normalization. I'll have to think about which one would be more appropriate here.
AN
Annamaria
1 year ago
I'm confident that one-hot encoding is the way to go for this. It creates new binary columns for each category, which should help the model work with the categorical data. Not sure about the other option though.
EV
Eveline
1 year ago
Okay, let me think this through. One-hot encoding converts categorical variables into a format that algorithms can better understand. And label encoding assigns numerical labels to each category. Those sound like the right choices for this question.
NU
Nu
1 year ago
I'm a bit unsure about this one. I know one-hot encoding is used for categorical features, but I'm not sure about the other option.
BE
Bev
1 year ago
Hmm, this seems straightforward. I think one-hot encoding and label encoding are the two techniques I should use here.
TW
Twana
1 year ago
Normalization? Scaling? What is this, a beauty pageant? Give me those one-hot and label encoders any day! Let's keep it simple, folks.
KR
Kristel
1 year ago
Normalization and scaling can be useful too, but sometimes simpler is better.
PH
Phillip
1 year ago
I agree, one-hot encoding and label encoding are the way to go.
MA
Markus
1 year ago
Normalization and scaling can be useful too, but sometimes simpler is better.
LA
Latrice
1 year ago
I agree, one-hot encoding and label encoding are the way to go.
DU
Dustin
1 year ago
I'm with Elza on this one. B and D are the way to go. Although, I do like Ellen's 'make everything linear' approach. Sounds like a real time-saver!
JE
Jess
1 year ago
I'm not sure about linearization, but I definitely think B and D are the way to go.
VA
Val
1 year ago
I think Ellen's idea of linearizing everything is interesting, but I still prefer B and D.
EL
Elin
1 year ago
I agree with Elza, B and D are the best choices.
EL
Ellen
1 year ago
Hmm, I was thinking C and F. Linearization and pivoting, you know? Who needs all that fancy one-hot stuff when you can just make everything linear, right? *wink wink*
EL
Elza
1 year ago
Definitely B and D. One-hot encoding to create binary columns, and label encoding to turn the categories into numerical values. Easy peasy!
PE
Peter
1 year ago
Both techniques will definitely make the categorical features more useful for modeling.
WY
Wynell
1 year ago
Label encoding is also useful for turning categories into numerical values.
AR
Aretha
1 year ago
I agree, one-hot encoding is great for creating binary columns.
VA
Val
1 year ago
Label encoding is also useful for turning categories into numerical values.
MA
Marisha
1 year ago
I agree, one-hot encoding is great for creating binary columns.
JE
Jeniffer
1 year ago
I'm not sure about Label encoding. I think Normalization and Scaling would be more useful for building a model.
ST
Stefanie
1 year ago
I agree with Ona. One-hot encoding helps with categorical variables and Label encoding assigns a unique numerical value to each category.
ON
Ona
1 year ago
I think the data scientist should use One-hot encoding and Label encoding.
CO
Corinne
1 year ago
I'm pretty sure one-hot encoding and label encoding are the way to go here. Normalizing and scaling won't help with categorical features.
TE
Terrilyn
1 year ago
Pivoting and linearization wouldn't be useful for transforming categorical features.
AR
Ardella
1 year ago
Normalization and scaling are more for numerical features, not categorical ones.
KA
Kate
1 year ago
I agree, one-hot encoding and label encoding are the best choices for categorical features.