An ML engineer has survey answers that are only “yes” or “no.” They need to transform these responses into a single feature that improves model training without increasing the dataset’s dimensionality. Which methods satisfy these constraints? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Binary encoding (map categories to binary values), Label encoding (assign integer labels to categories).
Why this is the answer
Binary encoding and Label encoding both satisfy the constraints. Binary encoding maps "yes" to 1 and "no" to 0 (or vice versa), creating a single numerical feature without increasing dimensionality. Label encoding assigns integer labels, such as 0 for "no" and 1 for "yes," achieving the same outcome. One-hot encoding would create two new columns (one for "yes" and one for "no"), increasing dimensionality, which violates a constraint. Statistical imputation is for handling missing values, not for transforming categorical data into a single feature. Tokenization is used for text processing, not for binary categorical data.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed