A city permitting agency stores the filing department as a name with no rank, such as parks, health, transit, or finance. A pipeline replaces each name with a single integer and feeds those integers to a linear model. What did that encoding do wrong?
Select an answer to reveal the explanation.
Short Explanation
Numbering departments is like ranking friends as one, two, and three when they were only names on a list. That integer encoding imposed a false order on a nominal field, so your linear model treats the codes as ranked magnitudes. The trap is thinking the step built a binary column per department, which is a different encoding entirely.
Full Explanation
Label encoding replaces each category with an integer. On a nominal field such as filing department, those integers are arbitrary codes, but a linear model reads them as magnitudes and estimates a single slope, as if a larger code meant a more important department. The pipeline therefore invented an order the department names do not have. Standardizing to zero mean and unit variance is not what happened; there was no meaningful numeric scale to rescale, only names swapped for codes. Grouping a continuous measurement into bands is also a misdiagnosis, because the source field was never a measured amount. Building one indicator column per department would have avoided the fake rank, but that is one-hot encoding, and this pipeline produced a single integer instead. Exam caveat: some tree splits can isolate individual codes, yet the integers still imply an order, and this question is about the linear model that received them. Operational check: inspect the design matrix and confirm department enters as one numeric slope; if the names have no rank, replace that column with indicators before refitting.