One-Hot Encoding Ad Campaign Color Schemes for a Neural Network Without Implying Order
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?
Community Votes
100% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
One-hot encoding gives each color its own binary column, so the network sees independent category indicators rather than integers that imply blue is somehow larger than red. Label encoding would fabricate an ordinal relationship that does not exist in color.
An ML engineer is preparing categorical color-scheme data for a neural network that predicts advertising campaign success. Colors are nominal categories with no inherent order or magnitude, and neural networks require numeric input, so the encoding must convert categories to numbers without inventing a false ranking.
Applying label encoding so each color gets a unique integer, which makes the network treat the integers as ordered quantities. Padding is for sequence data, and dimensionality reduction is for compressing high-dimensional numeric features, so both are irrelevant to nominal categories.
Community Discussion (4 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
The color scheme is nominal categorical data: the colors have no natural order and no meaningful distance between them, yet a neural network can only consume numbers. One-hot encoding solves this by creating a separate binary column per color, so with three colors you get three columns where exactly one is 1, and the network receives independent presence indicators with no implied ranking. That is exactly the correct feature engineering treatment for nominal categories feeding a neural network. The vote was unanimous at 100 for D. GiorgioGss worked through a concrete red, blue, green example showing the three resulting binary vectors and explained that this lets the model use the color feature without assuming ordinal relationships, and Sadrik made the same point from the opposite direction.Why the Other Options Are Wrong
Applying label encoding so each color is assigned a unique integer (A) is actively harmful here, because integers carry magnitude and order; the network would effectively be told that one color is larger or more important than another based on its arbitrary code, a false relationship the model would then learn. Implementing padding so all color feature vectors have the same length (B) is a sequence-data technique for making variable-length inputs uniform, and color categories are not sequences, so there is nothing to pad. Performing dimensionality reduction on the color categories (C) is a technique for compressing a large number of numeric features into fewer dimensions, and applying it to a small set of nominal categories both destroys information and solves a problem that does not exist here.Community Comment Notes
The community was unanimous at 100 for D and every substance comment agreed. Saransundar provided the cleanest mapping of technique to data type, associating label encoding with ordinal relationships, padding with sequence data, dimensionality reduction with high-dimensional data, and one-hot encoding with categorical data. GiorgioGss and Sadrik supplied the two complementary justifications: one showing the binary matrix that one-hot encoding produces, the other warning that label encoding makes the model assume a numerical relationship between colors that does not exist. Sid4ops summarized the rule of thumb that categorical data calls for one-hot encoding.Official Reference
Related Analysis
Practice All MLA-C01 Questions
Access 115 questions with complete answers and detailed explanations.
View Full MLA-C01 Practice Test →