AWS Certified Machine Learning Engineer – Associate (MLA-C01) — Question 26
A company wants to predict the success of advertising campaigns by considering the color scheme of each advertisement. An ML engineer is preparing data for a neural network model. The dataset includes color information as categorical data.
Which technique for feature engineering should the ML engineer use for the model?
Answer options
- A. Apply label encoding to the color categories. Automatically assign each color a unique integer.
- B. Implement padding to ensure that all color feature vectors have the same length.
- C. Perform dimensionality reduction on the color categories.
- D. One-hot encode the color categories to transform the color scheme feature into a binary matrix.
Correct answer: D
Explanation
The correct answer is D because one-hot encoding effectively converts categorical color data into a format that can be easily processed by the neural network, creating binary columns for each color. Option A, label encoding, may introduce unintended ordinal relationships among colors, while options B and C are not appropriate for handling categorical data.